// Javascript (C)David Tyler 2009function defined(p){ return typeof p == "undefined" ? false : true; }function $(i){	if(Element.isObject(i)){		return i;		}	else if(document.getElementById(i) != null){		return document.getElementById(i);		}	else if(parent.document.getElementById(i) != null){		return parent.document.getElementById(i);		}	else{		Console.log('Notice: $ was unable to find element "'+i+'"');		return false;		}	}function $$(e,p){ p = p || document; return p.getElementsByTagName(e); }function $$$(c){	if(document.getElementsByClassName){		return document.getElementsByClassName(c);		}	else{		var ret = [];		var el = document.getElementsByTagName('*');		for(var i = 0; i < el.length; i++){			if(el[i].className == c){				ret[ret.length] = el[i];				}			}		return ret;		}	}try{	HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode){		switch (where){			case 'beforeBegin': this.parentNode.insertBefore(parsedNode,this);			break;			case 'afterBegin': this.insertBefore(parsedNode,this.firstChild);			break;			case 'beforeEnd': this.appendChild(parsedNode);			break;			case 'afterEnd': if (this.nextSibling) {					this.parentNode.insertBefore(parsedNode,this.nextSibling);					}				else {					this.parentNode.appendChild(parsedNode);					}			break;			}		};	HTMLElement.prototype.insertAdjacentHTML = function (where,htmlStr) {		var r = this.ownerDocument.createRange();		r.setStartBefore(this);		var parsedHTML = r.createContextualFragment(htmlStr);		this.insertAdjacentElement(where,parsedHTML);		};	HTMLElement.prototype.insertAdjacentText = function (where,txtStr) {		var parsedText = document.createTextNode(txtStr);		this.insertAdjacentElement(where,parsedText);		};	}catch(e){}var Console = {	Log: [],	Prompt: function(){		var input = prompt("Custom Evaluation:\r\n");		eval(input);		},	last: function(){		alert('Last message in Log:\n\n'+Console.Log[Console.Log.length-1]);		},	log: function(message){		try{			console.log(message);			}		catch(e){			Console.Log[Console.Log.length] = message;			}		},	developer: function(message){		if(window.developer == true){			alert('Developer Notice:\n\n'+message);			}		},	alert: function(message){		Console.log('Alert: '+message);		alert(message);		},	notice: function(message){		Console.log('Notice: '+message);		},	warning: function(message){		Console.log('Warning: '+message);		Console.developer(message);		},	error: function(message){		Console.log('Error: '+message);		Console.developer('An error occured:\n\n'+message);		},	critical: function(message){		Console.log('Critical Error: '+message);		alert('A critical error occured:\n\n'+message+'\n\n[Page has stopped loading]');		}	};var Event = {	Add: function(obj, event, fn){		if(obj.addEventListener){			obj.addEventListener(event, fn, true);			}		else{			obj.attachEvent("on"+event, fn);			}		},	Remove: function(obj, event, fn){		if(obj.removeEventListener){			obj.removeEventListener(event, fn, false);			}		else{			obj.detachEvent('on'+event, fn);			}		},	Cancel: function(e){		if (!e){			return false;			}		if (window.browser == "Internet Explorer"){			e.returnValue = false;			e.cancelBubble = true;			}		else {			e.preventDefault();			e.stopPropagation && e.stopPropagation();			}		return false;		},	Placeholders: function(){		if($('user_holder')){			var up = $('user_holder');			var pp = $('pass_holder');			var ui = $('user_input');			var pi = $('pass_input');			if (ui.captureEvents) ui.captureEvents(Event.BLUR);			if (pi.captureEvents) pi.captureEvents(Event.BLUR);			if (up.captureEvents) up.captureEvents(Event.FOCUS);			if (pp.captureEvents) pp.captureEvents(Event.FOCUS);			up.onfocus = function (){				ui.style.display = 'block';				up.style.display = 'none';				ui.focus();				}			pp.onfocus = function (){				pi.style.display = 'block';				pp.style.display = 'none';				pi.focus();				}			ui.onblur = function (){				if(ui.value == ''){					ui.style.display = 'none';					up.style.display = 'block';					}				}			pi.onblur = function (){				if(pi.value == ''){					pi.style.display = 'none';					pp.style.display = 'block';					}				}			}		}  };var Element = {	byAttribute: function(a, v, t, p, o){		if (arguments.length < 2) v = '*';		if (arguments.length < 3) t = '*';		if (arguments.length < 4) p = document;		if (arguments.length < 5) o = false;		var r = [], e = $$(t, p), i;		for(i = 0; i < e.length; i++){			if(o == true && (e[i].getAttribute(a) !== null && ((e[i].getAttribute(a).indexOf(v) != -1 ) || v == '*'))) r.push(e[i]);			else if(e[i].getAttribute(a) !== null && (e[i].getAttribute(a) == v || v == '*')) r.push(e[i]);			}		return r;		},	byTag: function(t, a, v, p){		if (arguments.length < 2) a = '*';		if (arguments.length < 3) v = '*';		if (arguments.length < 4) p = document;		var r = [], e = $$(t, p), i;		for(i = 0; i < e.length; i++){			if((e[i].getAttribute(a) !== null || a == '*') && (e[i].getAttribute(a) == v || v == '*')) r.push(e[i]);			}		return r;		},	getAttribute: function(element, attr, tag){		if (arguments.length != 3){ tag = '*'; }		var attrs = [];		var el = element.getElementsByTagName(tag);		for(var i = 0; i < el.length; i++){			if(typeof(attr) == "string"){ attrs[0] = attr; }			else{ attrs = attr; }			for(var j = 0; j < attrs.length; j++){				if (el[i].tagName == 'IMG'){					var img = Element.Preload(el[i].src);					if (attrs[j].substring(0, 5) == 'style'){						var style_attr = attrs[j].substring(6);						if(img[style_attr] !== null && img[style_attr] != ''){							return img[style_attr];							}						}					if(el[i].style[attrs[j]] !== null && el[i].style[attrs[j]] != ''){						return el[i].style[attrs[j]]						}					}				if (attrs[j].substring(0, 5) == 'style'){					var style_attr = attrs[j].substring(6);					if(el[i].style[style_attr] !== null && el[i].style[style_attr] != ''){						return el[i].style[style_attr];						}					}				else{					if(el[i].getAttribute(attrs[j]) !== null && el[i].getAttribute(attrs[j]) != ''){						return el[i].getAttribute(attrs[j]);						}					}				}			}		return false;		},	readAttribute: function(element, name) {		element = $(element);		return element.getAttribute(name);		},	setAttribute: function(element, attribute, value) {		element = $(element);		element.setAttribute(attribute, name);		return element;		},	Style: function(element, property, alt){		if(!defined(alt)) alt = property;		element = $(element);		if(!element){ return null; }		if(property == 'opacity'){			if(defined(element.style.opacity)){				return element.style.opacity;				}			else if(defined(element.style.MozOpacity)){				return element.style.MozOpacity;				}			else if(defined(element.style.filter)){				return String.isolate(element.style.filter)/100;				}			else if(defined(element.style.KHTMLOpacity)){				return element.style.KHTMLOpacity;				}			return '';			}		var w = false, r;		if(element.currentStyle){			return eval("element.currentStyle." + property);			}		if(Browser.AS && element.style.display == "none"){			element.style.display = ""; w = true;			}		r = document.defaultView.getComputedStyle(element, '').getPropertyValue(alt);		if(w) element.style.display = "none";		return r;		},	setStyle: function(element, property, value){		element = $(element);		if(property == 'opacity'){			return Element.setOpacity(element, value);			}		try{			element.style[property] = value;			}		catch(e){			try{				element.currentStyle[property] = value;				}			catch(f){				try{					document.defaultView.getComputedStyle(element, null).getPropertyValue(property) = value;					}				catch(g){ }				}			}		},	setOpacity: function(element, opacity){		if(defined(element.style.opacity)){			element.style.opacity = opacity;			}		else if(defined(element.style.MozOpacity)){			element.style.MozOpacity = opacity;			}		else if(defined(element.style.filter)){			element.style.filter = "alpha(opacity:" + opacity*100 + ")";			}		else if(defined(element.style.KHTMLOpacity)){			element.style.KHTMLOpacity = opacity;			}		},	remove: function(i){		try{			i.parentNode.removeChild(i);			return true;			}		catch(e){			return false;			}		},	show: function(i){		$(i).style.visibility = "visible";		},	hide: function(i){		$(i).style.visibility = "hidden";		},	showhide: function(i){		$(i).style.visibility = $(i).style.visibility=="visible" ? "hidden" : "visible";		},	display: function(i){		$(i).style.display = '';		},	undisplay: function(i){		$(i).style.display = 'none';		},	toggle: function(i){		$(i).style.display = $(i).style.display=="" ? "none" : "";		},	visible: function(i) {		return $(i).style.display != 'none' && $(i).style.visibility != 'hidden';		},	hidden: function(i){		return Element.Style(i, 'visibility') == 'hidden';		},	getPageSize: function(){		var xScroll, yScroll;		if (window.innerHeight && window.scrollMaxY) {				xScroll = window.innerWidth + window.scrollMaxX;			yScroll = window.innerHeight + window.scrollMaxY;			}		else if (document.body.scrollHeight > document.body.offsetHeight){			xScroll = document.body.scrollWidth;			yScroll = document.body.scrollHeight;			}		else {			xScroll = document.body.offsetWidth;			yScroll = document.body.offsetHeight;		}		var windowWidth, windowHeight;		if (self.innerHeight) {			if(document.documentElement.clientWidth){				windowWidth = document.documentElement.clientWidth; 				}			else {				windowWidth = self.innerWidth;				}			windowHeight = self.innerHeight;			}		else if (document.documentElement && document.documentElement.clientHeight){			windowWidth = document.documentElement.clientWidth;			windowHeight = document.documentElement.clientHeight;			}		else if (document.body) {			windowWidth = document.body.clientWidth;			windowHeight = document.body.clientHeight;			}			if(yScroll < windowHeight){			pageHeight = windowHeight;			}		else { 			pageHeight = yScroll;			}		if(xScroll < windowWidth){				pageWidth = xScroll;					}		else {			pageWidth = windowWidth;			}		return [pageWidth,pageHeight];		},	Height: function(element) {		element = $(element);		var display = Element.Style(element, 'display');		if (display != 'none' && display != null){			return element.offsetHeight;			}		var originalVisibility = element.style.visibility;		var originalPosition = element.style.position;		var originalDisplay = element.style.display;		element.style.visibility = 'hidden';		element.style.position = 'absolute';		element.style.display = 'block';		var originalWidth = element.clientWidth;		var originalHeight = element.clientHeight;		element.style.display = originalDisplay;		element.style.position = originalPosition;		element.style.visibility = originalVisibility;		return originalHeight;		},	Width: function(element) {		element = $(element);		var display = Element.Style(element, 'display');		if (display != 'none' && display != null){			return element.offsetWidth;			}		var originalVisibility = element.style.visibility;		var originalPosition = element.style.position;		var originalDisplay = element.style.display;		element.style.visibility = 'hidden';		element.style.position = 'absolute';		element.style.display = 'block';		var originalWidth = element.clientWidth;		element.style.display = originalDisplay;		element.style.position = originalPosition;		element.style.visibility = originalVisibility;		return originalWidth; 		},	X: function(e){		e = $(e);		var X = 0;		do {			X += e.offsetLeft || 0;			e = e.offsetParent;			} while (e);		return X;		},	Y: function(e){		e = $(e);		var Y = 0;		do {			Y += e.offsetTop || 0;			e = e.offsetParent;			} while (e);		return Y		},	CheckAllPositions: function(){		var popups = Element.byAttribute("popup");		for(var i = 0; i < popups.length; i++){			var links = Element.byAttribute("popuplink", popups[i].getAttribute("popup"));			Element.CheckOnePosition(popups[i], links[0]);			}		},	CheckOnePosition: function(element, link){		var eX = Element.X(element.id);		var ew = element.offsetWidth;		var lw = Element.getAttribute(link, ['width', 'style.width']);		if (lw == false){			lw = 0;			}		var styleleft = (-ew-lw) + "px";		if((element.style.left != styleleft) && (eX > (document.documentElement.clientWidth-ew))){			element.style.left = styleleft;			}		else if((element.style.left == styleleft) && (eX < (document.documentElement.clientWidth-(2*ew)))){			element.style.left = "0px";			}		},	Preload_list: [],	Preload: function(src, onload){		Element.Preload_list[Element.Preload_list.length] = new Image();		Element.Preload_list[Element.Preload_list.length -1].src = src;		if(defined(onload)){			Element.Preload_list[Element.Preload_list.length -1].onload = onload;			}		return Element.Preload_list[Element.Preload_list.length -1];		},	hideByTag: function(tags, vis){		for(var i = 0; i < tags.length; i++){			var els = $$(tags[i]);			for(var j = 0; j < els.length; j++){				els[j].style.visibility = vis;				}			}		},	merge: function(donor, child){		for(prop in donor){			if(!defined(child[prop])){				child[prop] = donor[prop];				}			}		return child;		},	scrollTo: function(element, container){		try{			element = $(element);			container = $(container);			container.scrollTop = element.offsetTop;			}		catch(e){}		},	isString: function(object) {		return typeof object == "string";		},	isElement: function(object) {		return object && object.nodeType == 1;		},	isObject: function(object){		return typeof object == "object";		},	isArray: function(object) {		return object != null && typeof object == "object" &&		'splice' in object && 'join' in object;		},	isHash: function(object) {		return object instanceof Hash;		},	isFunction: function(object) {		return typeof object == "function";		},	isNumber: function(object) {		return typeof object == "number";		},	isUndefined: function(object) {		return typeof object == "undefined";		}	};var Effect = {	X: [],	IsOn: function(effect, element){		var r = [];		for(var i = 0; i < Effect.X.length; i++){			if(Effect.X[i]['s'] == true && Effect.X[i]['e'] == effect && Effect.X[i]['i'] == element) r.push(i);			}		return (r.length == 0) ? false : r;		},	Stop: function(id){		if(typeof id != "object"){ var ids = []; ids[0] = id; }		else var ids = id;		for(var i = 0; i < ids.length;i++){			Effect.X[ids[i]]['s'] = false;			}		},	Appear: function(element, options){		if(!defined(options)){ options = []; }		element = $(element);		options = Element.merge({property: 'opacity', start: 0.0, finish: 1.0, duration: 1000, onload: null, label: '' }, options);		Element.show(element);		Element.display(element);		Effect.Execute('appear', element, options);		},	Disappear: function(element, options){		if(!defined(options)){ options = []; }		options = Element.merge({ property: 'opacity', start: 1.0, finish: 0.0, duration: 1000, onload: null, label: '' }, options);		Effect.Execute('disappear', $(element), options);		},	XScale: function(element, options){		if(!defined(options)){ options = []; }		options = Element.merge({ property: 'width', start: 0, finish: 100, duration: 1000, onload: null, label: 'px' }, options);		Effect.Execute('xscale', $(element), options);		},	YScale: function(element, options){		options = Element.merge({ property: 'height', start: 0, finish: 100, duration: 1000, onload: null, label: 'px' }, options);		Effect.Execute('yscale', $(element), options);		},	Execute: function(effect, element, options){		var id = Effect.X.length;		if(Effect.IsOn(effect, element)) Effect.Stop(Effect.IsOn(effect, element));		Effect.X[id] = [];		Effect.X[id]['e'] = effect;		Effect.X[id]['i'] = element;		Effect.X[id]['s'] = true;		var increment = ((options.finish - options.start)/20);		if(options.onload != null) Timer.set(options.onload, options.duration);		Element.setStyle(element,options.property,((String.isolate(options.start)*1).toString() + String.label(options.start)));		Effect.Process(id, element, options.property, (String.isolate(options.start)*1), options.start, options.finish, increment, options.label, (options.duration/20));		},	Process: function(id,e,p,c,s,f,i,l,w){		if(Effect.X[id]['s'] == true && ((s > f && c > f) || (s < f && c < f))){			Timer.set(function(){Effect.Process(id,e,p,c,s,f,i,l,w);}, w);			c = (c*1+i*1);			Element.setStyle(e, p, c.toString()+l);			}		else{			Effect.Stop(id);			}		}	};var String = {	Request: function(p){		p = String.replace(p, "[\[]", "\\\[");		p = String.replace(p, "[\]]", "\\\]");		var s = "[\\?&]"+p+"=([^&#]*)";		var r = new RegExp(s);		var r = r.exec(window.location.href);		if (r === null){ return ""; }		else { return r[1]; }		},	replace: function(string, find, replace){		return string.replace(find, replace, 'g');		},	ajaxencode: function(string){		return encodeURIComponent(escape(String.replace(string, "+", "%2B")));		},	unescape: function(string){		return String.replace(unescape(string), "%2B", "+");		},	toHexColor: function(color) {		color = color.replace(/^rgb/g,'');		color = color.replace(/\(/g,'');		color = color.replace(/\)/g,'');		color = color.replace(/ /g,'');		color = color.split(',');		var r = parseFloat(color[0]).toString(16).toUpperCase();		var g = parseFloat(color[1]).toString(16).toUpperCase();		var b = parseFloat(color[2]).toString(16).toUpperCase();		if (r.length<2) { r='0'+r; }		if (g.length<2) { g='0'+g; }		if (b.length<2) { b='0'+b; }		return r + g + b;		},	decToRgb: function(value) {		var hex_string = "";		for (var hexpair = 0; hexpair < 3; hexpair++) {			var myByte = value & 0xFF;			value >>= 8;			var nybble2 = myByte & 0x0F;			var nybble1 = (myByte >> 4) & 0x0F;			hex_string += nybble1.toString(16);			hex_string += nybble2.toString(16);			}		return hex_string.toUpperCase();		},	rgbToHex: function(str) {		if(str == null) return "";		var matcher = str.match(/rgb\([0-9 ]+,[0-9 ]+,[0-9 ]+\)/gi);		if(matcher) {			for(var j = 0; j < matcher.length; j++) {				var regex = eval("/" + String.toRegex(matcher[j]) + "/gi");				str = str.replace(regex, "#" + String.toHexColor(matcher[j]));			}		}		return str;		},	toRegex: function(string) {		string = string.replace(/\//gi, "\\/");		string = string.replace(/\(/gi, "\\(");		string = string.replace(/\)/gi, "\\)");		string = string.replace(/\[/gi, "\\[");		string = string.replace(/\]/gi, "\\]");		string = string.replace(/\+/gi, "\\+");		string = string.replace(/\$/gi, "\\$");		string = string.replace(/\*/gi, "\\*");		string = string.replace(/\?/gi, "\\?");		string = string.replace(/\^/gi, "\\^");		string = string.replace(/\\b/gi, "\\\\b");		string = string.replace(/\\B/gi, "\\\\B");		string = string.replace(/\\d/gi, "\\\\d");		string = string.replace(/\\B/gi, "\\\\B");		string = string.replace(/\\D/gi, "\\\\D");		string = string.replace(/\\f/gi, "\\\\f");		string = string.replace(/\\n/gi, "\\\\n");		string = string.replace(/\\r/gi, "\\\\r");		string = string.replace(/\\t/gi, "\\\\t");		string = string.replace(/\\v/gi, "\\\\v");		string = string.replace(/\\s/gi, "\\\\s");		string = string.replace(/\\S/gi, "\\\\S");		string = string.replace(/\\w/gi, "\\\\w");		string = string.replace(/\\W/gi, "\\\\W");		return string;		},	toArray: function() {		return this.split('');		},	strip: function(string) {		return string.replace(/^\s*|\s*$/g,'');		},	includes: function(string, pattern) {		return string.indexOf(pattern) > -1;		},	Slice: function(s){		return s.slice(0, s.indexOf("px"));		},	isolate: function(string){		string = string.toString();		return string.replace(/[^0-9\.]/g,'');		},	label: function(string){		string = string.toString();		return string.replace(/[0-9\.]/g,'');		}	};var Timer = {	list: [],	set: function(code, ms){		try{			var ret = parent.window.setTimeout(code, ms);			Timer.list[Timer.list.length] = code;			return ret;			}		catch(e){			try{				var ret = window.setTimeout(code, ms);				Timer.list[Timer.list.length] = code;				return ret;				}			catch(e){}			}		return false;		},	cancel: function(tID){		if (tID != '*'){			try{				parent.window.clearTimeout(tID);				}			catch(e){				try{					window.clearTimeout(tID);					}				catch(e){}				}			}		else{			for (var i = 0; i < Timer.list.length; i++){				try{					parent.window.clearTimeout(Timer.list[i]);					}				catch(e){					try{						window.clearTimeout(Timer.list[i]);						}					catch(e){}					}				}			}		}	};var Browser = {	init: function(){		Browser.Name = Browser.find(Browser.Browsers) || "Unknown Browser";		Browser.Version = Browser.getVersion(navigator.userAgent) || Browser.getVersion(navigator.appVersion) || "Unknown version";		Browser.OS = Browser.find(Browser.OSs) || "Unknown OS";		Browser.Full = Browser.Name+' '+Browser.Version+' on '+Browser.OS;		Browser.IE = (Browser.Name == 'InternetExplorer') ? true : false;		Browser.FF = (Browser.Name == 'Firefox') ? true : false;		Browser.AS = (Browser.Name == 'Safari') ? true : false;		if(!document.getElementById) alert("Warning: This browser is not compatable with current W3C Standards!\n\nPlease Upgrade your browser so that all features of this website will work correctly!");		},	Width: function() {		return window.innerWidth || document.body.offsetWidth || document.documentElement.clientWidth || document.body.clientWidth || 0;		},	Height: function() {		return window.innerHeight || document.body.offsetHeight || document.documentElement.clientHeight || document.body.clientWidth || 0;		},	PageSize: function(){		var SW, SH, WW = Browser.Width(), WH = Browser.Height();		if (window.innerHeight && window.scrollMaxY) {			SW = document.body.scrollWidth;			SH = window.innerHeight + window.scrollMaxY;			}		else if (document.body.scrollHeight > document.body.offsetHeight){			SW = document.body.scrollWidth;			SH = document.body.scrollHeight;			}		else {			SW = document.body.offsetWidth;			SH = document.body.offsetHeight;			}		return [((SW < WW) ? WW : SW), ((SH < WH) ? WH : SH)];		},	Goto: function(u){		document.location.href = u;		},	ScrollLeft: function() {		return window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft;		},	ScrollTop: function(){		return window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;		},	find: function (data) {		for (i in data){			var dataString = data[i].string, dataProp = data[i].prop;			Browser.versionSearchString = data[i].versionSearch || i;			Browser.versionAltSearch = data[i].versionAltSearch;			if ((dataString && dataString.indexOf(data[i].subString) != -1) || dataProp){				return i;				}			}		return false;		},	getVersion: function (dataString){		var index = dataString.indexOf(Browser.versionSearchString);		var temp = index+Browser.versionSearchString.length;		if (index == -1 && Browser.versionAltSearch){			index = dataString.indexOf(Browser.versionAltSearch);			temp = index+Browser.versionAltSearch.length;			}		if (index == -1){ return false; }		var r = dataString.substring(temp+1, temp+40), exclude = [';', ' ', '(', ')'];		for(var i = 0; i < exclude.length; i++){			temp = r.indexOf(exclude[i]);			if(temp != -1){ r = r.substring(0, temp); }			}		return r;	},	Browsers: {		Chrome: {			string: navigator.userAgent,			subString: "Chrome"			},		GoogleToolbar: {			string: navigator.userAgent,			subString: "GoogleToolbar",				versionSearch: "GoogleToolbar"			},		AskToolbar: {			string: navigator.userAgent,			subString: "AskBar",			versionSearch: "AskBar"			},		FeedDemon: {			string: navigator.userAgent,			subString: "FeedDemon",			versionSearch: "FeedDemon"			},		BlackBerry: {			string: navigator.userAgent,			subString: "BlackBerry",			versionSearch: "BlackBerr"			},		OmniWeb: {			string: navigator.userAgent,			subString: "OmniWeb",			versionSearch: "OmniWeb/"			},		Safari: {			string: navigator.vendor,			subString: "Apple",			versionSearch: "Version"			},		Safari: {			string: navigator.userAgent,			subString: "Safari",			versionSearch: "Safari"			},		Flock: {			string: navigator.userAgent,			subString: "Flock",			versionSearch: "Flock"			},		Opera: {			prop: window.opera			},		iCab: {			string: navigator.vendor,			subString: "iCab"			},		Konqueror: {			string: navigator.vendor,			subString: "KDE"			},		Firefox: {			string: navigator.userAgent,			subString: "Firefox"			},		Camino: {			string: navigator.vendor,			subString: "Camino"			},		SeaMonkey: {			string: navigator.userAgent,			subString: "SeaMonkey",			versionSearch: "SeaMonkey"			},		Netscape: {			string: navigator.userAgent,			subString: "Netscape"			},		SeaMonkey: {			string: navigator.userAgent,			subString: "Gecko",			versionSearch: "SeaMonkey",			versionAltSearch: "rv"			},		InternetExplorer: {			string: navigator.userAgent,			subString: "MSIE",			versionSearch: "MSIE"			},		Opera: {			string: navigator.userAgent,			subString: "Opera",			versionSearch: "Opera"			},		GoogleBot: {			string: navigator.userAgent,			subString: "Googlebot",			versionSearch: "Googlebot"			},		Netscape: {			string: navigator.userAgent,			subString: "Mozilla",			versionSearch: "Mozilla"			},		MSNSearchBot: {			string: navigator.userAgent,			subString: "msnbot",			versionSearch: "msnbot"			}		},	OSs: {		Windows: {			string: navigator.platform,			subString: "Win"			},		Windows: {			string: navigator.userAgent,			subString: "Windows"			},		Mac: {			string: navigator.platform,			subString: "Mac"			},		MacOSX: {			string: navigator.userAgent,			subString: "Mac OS X"			},		BlackBerry: {			string: navigator.userAgent,			subString: "BlackBerry"			},		iPhone: {			string: navigator.userAgent,			subString: "iPhone"			},		Linux: {			string: navigator.platform,			subString: "Linux"			}		},	display: function(){		Console.alert('You are using\n'+Browser.Full+'\n\nBrowser Stats:\nappName\t\t\t'+navigator.appName+'\nappVersion\t\t'+navigator.appVersion+'\nappMinorVersion\t'+navigator.appMinorVersion+'\nproduct\t\t\t'+navigator.product+'\nproductSub\t\t'+navigator.productSub+'\nuserAgent\t\t'+navigator.userAgent+'\nvendor\t\t'+navigator.vendor+'\nvendorSub\t\t'+navigator.vendorSub+'\nplatform\t\t\t'+navigator.platform);		}	};var Cookie = {	set: function(name, value, expire){		var d = new Date();		d.setDate(d.getDate()+expire);		expire = ((expire === null) ? "" : ";expires="+d.toGMTString());		document.cookie = name+"="+escape(value)+expire;		},	get: function(name){		if (document.cookie.length > 0){			start = document.cookie.indexOf(name + "=");			if (start != -1){				start = start + name.length+1;				end = document.cookie.indexOf(";", start);				if (end == -1) end = document.cookie.length;				return unescape(document.cookie.substring(start, end));				}			}		return "";		},	del: function(name){		document.cookie = name+"=;expires=Thu, 01-Jan-1970 00:00:01 GMT";		}	};var Popup = {	preload: function(){		Element.Preload('images/close.png');		Element.Preload('images/close_over.png');		Element.Preload('images/close_down.png');		},	FixIe: function(){		if (Browser.IE && $$$('generic_popup').length == 0){			var b = parent.document.getElementsByTagName('body')[0];			var h = parent.document.getElementsByTagName('html')[0];			b.style.height = '100%';			b.style.overflow = 'hidden';			h.style.height = '100%';			h.style.overflow = 'hidden';			var ss = parent.document.getElementsByTagName('select');			for(i = 0; i < ss.length; i++){				ss[i].style.visibility = 'hidden';				}			}		},	UnFixIe: function(){		if (Browser.IE && $$$('generic_popup').length == 1){			var b = parent.document.getElementsByTagName('body')[0], h = parent.document.getElementsByTagName('html')[0], s = parent.document.getElementsByTagName('select'), i;			b.style.height = 'auto';			b.style.overflow = 'auto';			h.style.height = 'auto';			h.style.overflow = 'auto';			for(i = 0; i < s.length; i++){				s[i].style.visibility = 'visible';				}			}		},	Help: function(what){		return '<a onclick="Popup.Info(\''+what+'\');" title="Help"><img src="images/help.png"></a>';		},	Generic: function(type, content, width, height, order, noclose){		if($('popup_'+type+'_content')){			$('popup_'+type+'_content').innerHTML = content;			return true;			}		if(!defined(height)) height = '';		if(!defined(width)) width = '';		var body = parent.document.getElementsByTagName('body')[0];		var popup = parent.document.createElement('div');		var overlay = parent.document.createElement('div');		var noclosecode = (!defined(noclose)) ? '<div class="generic_popup_top_bar" align="right" style="position: absolute; width: 100%;"><img onclick="Popup.Close(\''+type+'\');" src="images/close.png" onmouseover="this.src=\'images/close_over.png\'" onmouseout="this.src=\'images/close.png\'" onmousedown="this.src=\'images/close_down.png\'" onmouseup="this.src=\'images/close.png\'" /></div>' : '';		popup.innerHTML = '<div class="generic_popup_container" align="center" style="position: relative;  width: '+width+'; margin: 0 auto; border: 10px solid #555555;">'+noclosecode+'<div id="popup_'+type+'_content" align="center" style="overflow-y: auto; height: '+height+'; width: '+width+'; color: #000000;">' + content + '</div></div>';		popup.id = 'popup_'+type;		popup.style.top = Browser.ScrollTop() + (Browser.Height() / 10) + 'px';		popup.style.left = Browser.ScrollLeft() + 'px';		popup.style.position = 'absolute';		popup.style.width = '100%';		popup.style.zIndex = order;		popup.style.textAlign = 'center';		popup.style.visibility = 'hidden';		popup.className = 'generic_popup';		var arrayPageSize = Browser.PageSize();		overlay.id = 'popup_'+type+'_over';		overlay.style.width = '100%';		overlay.style.height = arrayPageSize[1]+'px';		overlay.style.visibility = 'hidden';		overlay.style.position = 'absolute';		overlay.style.top = '0';		overlay.style.left = '0';		overlay.style.zIndex = '900';		overlay.style.backgroundColor = '#000000';		body.appendChild(overlay);		body.appendChild(popup);		LightBox.init();		Popup.FixIe();		Effect.Appear(popup);		Effect.Appear(overlay, {finish:0.7});		return false;		},	Close: function(type){		Element.remove(parent.$('popup_'+type));		Element.remove(parent.$('popup_'+type+'_over'));		Popup.UnFixIe();		},	Frame: function(url){		return Popup.Generic('frame', '<iframe frameborder="0" width="700" height="450" src="'+url+'"></iframe>', '700px', '450px', '1000');				},	Frame_close: function(){ // Backwards Compatability		Popup.Close('frame');		},	Error: function(code, page){		return Popup.Generic('error', '<iframe frameborder="0" width="300" height="250" src="error.php?error_code='+code+'&caused_by='+page+'"></iframe>', '300px', '250px', '1200');		},	Info: function(what){		if(what == 'login'){			var title = 'Login Help:';			var text = 'To protect certain aspects of our website, we require our members to login. Instead of asking you to remember yet another login, you may use your Edline Username and Password. After Edline confirms you, we store an encripted version of your password so that the next time you login, it is much faster. If you do not have a Edline Login or your\'s does not work, please fill out the form on the Contact Us page and use \'Member Login\' for the Subject.';			}		if(what == 'login_failed'){			var title = 'Failed Login Help:';			var text = 'There are several reasons your login may have failed:<ul><li>Your Username or Password is Invalid</li><li>Your browser is blocking popups. The first time you login in, popups are required; for subsequent logins, they are not.</li><li>You are not a member of the Drama group on Edline. To be added or if you are not a member, fill out the Contact Us page and use "Member Login" as the subject</li></ul>';			}		if(defined(title)){			return Popup.Generic('info', '<div><table width="100%"><tr><td align="left" width="20px">&nbsp;</td><td align="center" id="pageTitle">'+title+'</td><td align="right" width="20px">'+Popup.CloseButton('Popup.Error_close()')+'</td></tr></table></div><div align="left" style="padding: 10px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+text+'</div>', '', '', '1400');			}		},	Note: function(message){		return Popup.Generic('note', '<div width="100%" align="center" valign="middle" style="background-color: #447744; color: #DDDDDD; valign:center;">'+message+'</div>', '100px', '', '1500', true);		},	Note_close: function(){ // Backwards Compatability		Popup.Close('note');		}	};var LightBox = {	init: function(){		Element.Preload('images/loading.gif');		var targets = Element.byTag('a', 'target', 'lightbox');		if(targets.length != 0){			document.body.insertAdjacentHTML("afterEnd", '<div id="LightBox_Overlay" onclick="LightBox.end();"></div><div id="LightBox"><div id="LightBox_Container"><img id="LightBox_Image"><div id="LightBox_Links"><a id="LightBox_PrevLink" onclick="LightBox.Previous();"></a><a id="LightBox_NextLink" onclick="LightBox.Next();"></a></div><div id="LightBox_Loading"><a onclick="LightBox.end()"><img src="images/loading.gif"></a></div><div id="LightBox_BottomBar"><div id="LightBox_Text"></div><div id="LightBox_Close"><a onclick="LightBox.end()"><img src="images/closelabel.gif"></a></div></div></div></div>');			LightBox.LightBox		= $('LightBox');			LightBox.Overlay		= $('LightBox_Overlay');			LightBox.Container		= $('LightBox_Container');			LightBox.Image			= $('LightBox_Image');			LightBox.Loading		= $('LightBox_Loading');			LightBox.PrevLink		= $('LightBox_PrevLink');			LightBox.NextLink		= $('LightBox_NextLink');			LightBox.Text			= $('LightBox_Text');			LightBox.Sets			= [];			LightBox.ActiveSet		= null;			LightBox.Status			= 'idle';			}		for (var i = 0; i < targets.length; i++){			LightBox.create(i, targets[i]);			}		},	create: function(N, E){		LightBox.Sets[N] = [];		LightBox.Sets[N].Link = E;		LightBox.Sets[N].borderSize = 10;		LightBox.Sets[N].ActiveImage = null;		LightBox.Sets[N].Images = [];		E.setAttribute('onclick', 'LightBox.Activate('+N+'); return false;'); 		},	Activate: function(N){		Console.log('Activating Lightbox #'+N);		if(LightBox.Status != 'idle') return;		LightBox.Status = 'loading...';		Element.hideByTag(['select', 'object', 'embed'], 'hidden');		KeyPress.event['Escape'] = 'LightBox.end('+N+');';		KeyPress.event['P'] = 'LightBox.Previous('+N+');';		KeyPress.event['Left Arrow'] = 'LightBox.Previous('+N+');';		KeyPress.event['N'] = 'LightBox.Next('+N+');';		KeyPress.event['Right Arrow'] = 'LightBox.Next('+N+');';		var arrayPageSize = Browser.PageSize();		LightBox.Overlay.style.width = arrayPageSize[0]+'px';		LightBox.Overlay.style.height = arrayPageSize[1]+'px';		LightBox.LightBox.style.top = Browser.ScrollTop() + (Browser.Height() / 10) + 'px';		LightBox.LightBox.style.left = Browser.ScrollLeft() + 'px';		Effect.Appear(LightBox.LightBox);		Effect.Appear(LightBox.Overlay, {finish: 0.7});		var i = 0;		if (LightBox.Sets[N].Link.getAttribute('group')){			LightBox.Sets[N].Images = Element.byTag('a', 'group', LightBox.Sets[N].Link.getAttribute('group'));			while (LightBox.Sets[N].Images[i] != LightBox.Sets[N].Link.href) i++;			}		else LightBox.Sets[N].Images[0] = LightBox.Sets[N].Link.href;		LightBox.change(N, i);		},	Previous: function(){		LightBox.change(LightBox.ActiveSet, LightBox.Sets[LightBox.ActiveSet].ActiveImage - 1);		},	Next: function(){		LightBox.change(LightBox.ActiveSet, LightBox.Sets[LightBox.ActiveSet].ActiveImage + 1);		},	change: function(N, newNum){		Console.log('Changing Lightbox #'+N+' to Image #'+newNum);		Element.show(LightBox.Loading);		Element.hide(LightBox.Image);		Element.hide(LightBox.PrevLink);		Element.hide(LightBox.NextLink);		LightBox.Text.innerHTML = '';		LightBox.ActiveSet = N;		LightBox.Sets[N].ActiveImage = newNum;		Element.Preload(LightBox.Sets[N].Images[LightBox.Sets[N].ActiveImage], function(){ LightBox.resize(N); });		},	resize: function(N) {		LightBox.Image.src = LightBox.Sets[N].Images[LightBox.Sets[N].ActiveImage];		var imgWidth = LightBox.Image.width;		var imgHeight = LightBox.Image.height;		var screenWidth = Browser.Width() - 30;		var screenHeight = Browser.Height() - 30;		var widthRatio = (imgWidth / screenWidth);		var heightRatio = (imgHeight / screenHeight);		if (widthRatio > 1 || heightRatio > 1){			if(widthRatio > heightRatio){				LightBox.Image.style.width = screenWidth + "px";				imgWidth = screenWidth;				LightBox.Image.style.height = (imgHeight / widthRatio) + "px";				imgHeight = (imgHeight / widthRatio);				}			else if(heightRatio > widthRatio){				LightBox.Image.style.height = screenHeight + "px";				imgHeight = screenHeight;				LightBox.Image.style.width = (imgWidth / heightRatio) + "px";				imgWidth = (imgWidth / heightRatio);				}			else {				LightBox.Image.style.height = screenHeight + "px";				imgHeight = screenHeight;				LightBox.Image.style.width = screenWidth + "px";				imgWidth = screenWidth;				}			}		var containerwidth = Element.Width(LightBox.Container);		var containerheight = Element.Height(LightBox.Container);		Effect.YScale(LightBox.Container, {start: containerheight, finish: (imgHeight + 30)});		Effect.XScale(LightBox.Container, {start: containerwidth, finish: (imgWidth + 20)});		Timer.set(function(){LightBox.showImage(N, containerheight); }, 1000);		},	showImage: function(N, containerheight){		Element.hide(LightBox.Loading);		Effect.Appear(LightBox.Image);		LightBox.Text.innerHTML = 'Image '+(LightBox.Sets[N].ActiveImage + 1) +' of '+LightBox.Sets[N].Images.length;		if(LightBox.Sets[N].Images[LightBox.Sets[N].ActiveImage + 1]){			LightBox.NextLink.style['height'] = containerheight+'px';			Element.show(LightBox.NextLink);			Element.Preload(LightBox.Sets[N].Images[LightBox.Sets[N].ActiveImage + 1]);			}		if(LightBox.Sets[N].Images[LightBox.Sets[N].ActiveImage - 1]){			LightBox.PrevLink.style['height'] = containerheight+'px';			Element.show(LightBox.PrevLink);			Element.Preload(LightBox.Sets[N].Images[LightBox.Sets[N].ActiveImage - 1]);			}		LightBox.Status = 'idle';		},	end: function(N) {		Console.log('Closing Lightbox #'+N);		if(LightBox.Status != 'idle') return;		LightBox.Status = 'ending...';		Effect.Disappear(LightBox.Overlay, {onload: "Element.hide(LightBox.Overlay); Element.undisplay(LightBox.Overlay); " } );		Effect.Disappear(LightBox.LightBox, {onload: "Element.hide(LightBox.LightBox); Element.undisplay(LightBox.LightBox); LightBox.Container.style.width = '250px'; LightBox.Container.style.height = '250px'; LightBox.Status = 'idle'" });		Element.hideByTag(['select', 'object', 'embed'], 'visible');		},	prep: function(donor, child){		var props = ['group', 'target', 'href', 'name'];		for(var i = 0; i < props.length; i++){			if(donor.getAttribute(props[i])){				child.setAttribute(props[i], donor.getAttribute(props[i]));				}			}		return child;		}	};var Calendar = {	timer_disable: false,	Config: [],	Today: new Date(),	Months: ['January','February','March','April','May','June','July','August','September','October','November','December'],	MonthDays: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],	WeekDays: ['S','M','T','W','T','F','S'],	getCalendar: function(N){		return $(Calendar.Config[N].calendarID);		},	setHidden: function(N, Value){		if(Calendar.Config[N].output == true){			Calendar.getHiddenField(N).value = Value;			}		},	getHiddenField: function(N){		return $(Calendar.Config[N].hiddenFieldID);		},	getMonthList: function(N){		return $(Calendar.Config[N].monthListID);		},	getDayList: function(N){		return $(Calendar.Config[N].dayListID);		},	getYearField: function(N){		return $(Calendar.Config[N].yearFieldID);		},	getMonthDisplay: function(N){		return $(Calendar.Config[N].monthDisplayID);		},	isShowing: function(N){		return (Calendar.getCalendar(N).style.visibility != 'visible') ? false : true;		},	PickDay: function(N, Day) {		Calendar.hide(N);		var MonthList = Calendar.getMonthList(N);		var DayList = Calendar.getDayList(N);		var YearField = Calendar.getYearField(N);		Calendar.FixDayList(DayList, Calendar.GetDayCount(Calendar.Config[N].displayed.yearValue, Calendar.Config[N].displayed.monthIndex));		for (var i=0; i<MonthList.length; i++){			if (MonthList.options[i].value == Calendar.Config[N].displayed.monthIndex){				MonthList.options[i].selected = true;				}			}		for (var j = 1; j <= DayList.length; j++){			if (j == Day){				DayList.options[j-1].selected = true;				}			}		Calendar.PickMonth(N, Calendar.Config[N].displayed.yearValue, Calendar.Config[N].displayed.monthIndex, Day);		YearField.value = Calendar.Config[N].picked.yearPad;		YearField.defaultValue = YearField.value;		},	Build: function(N){		var HTML = '<table class="calendarTable" cellspacing="0" cellpadding="1"><tr class="calendarDays"><td id="'+N+'_Previous_ID" align="center" class="calendarPrev" onClick="Calendar.ChangeMonth(\''+N+'\', \'Previous\');" onMouseDown="Calendar.Click(this, true)" onMouseUp="Calendar.Click(this, false)" onMouseOver="Calendar.Hover(this, true)" onMouseOut="Calendar.Hover(this, false)" title="'+Calendar.Config[N].previous.monthName+'"></td><td id="'+N+'_Current_ID" align="center" class="calendarCurrent" colspan="5" onClick="Calendar.ChangeMonth(\''+N+'\', \'Current\');" onMouseDown="Calendar.Click(this, true)" onMouseUp="Calendar.Click(this, false)" onMouseOver="Calendar.Hover(this, true)" onMouseOut="Calendar.Hover(this, false)" title="Show Current Month">'+ Calendar.Config[N].displayed.fullName+'</td><td id="'+N+'_Next_ID" align="center" class="calendarNext" onClick="Calendar.ChangeMonth(\''+N+'\', \'Next\');" onMouseDown="Calendar.Click(this, true)" onMouseUp="Calendar.Click(this, false)" onMouseOver="Calendar.Hover(this, true)" onMouseOut="Calendar.Hover(this, false)" title="'+Calendar.Config[N].next.monthName + '"></td></tr><tr class="calendarDaysHeader">';		for (var w = 0; w < 7; w++){			HTML += '<td align="center" class="">' + Calendar.WeekDays[w] + '</td>';			}		HTML += '</tr>';		var Rows = 5;		var rclass = '';		if (((Calendar.Config[N].displayed.dayCount == 31) && (Calendar.Config[N].displayed.firstDay > 4)) || ((Calendar.Config[N].displayed.dayCount == 30) && (Calendar.Config[N].displayed.firstDay == 6))){			Rows = 6;			}		else if ((Calendar.Config[N].displayed.dayCount == 28) && (Calendar.Config[N].displayed.firstDay == 0)){			Rows = 4;			}		var HTML = '<table class="calendarDayTable" cellspacing="0" cellpadding="1">';		for (var j = 0; j < Rows; j++){			HTML += '<tr>';			for (var i = 1; i <= 7; i++) {				Day = (j * 7) + (i - Calendar.Config[N].displayed.firstDay);				if ((Day >= 1) && (Day <= Calendar.Config[N].displayed.dayCount)){					if ((Calendar.Config[N].displayed.yearValue == Calendar.Today.getFullYear()) && (Calendar.Config[N].displayed.monthIndex == Calendar.Today.getMonth()) && (Day == Calendar.Today.getDate())){						rclass = 'calendarDayToday';						}					else if ((Calendar.Config[N].displayed.yearValue == Calendar.Config[N].picked.yearValue) && (Calendar.Config[N].displayed.monthIndex == Calendar.Config[N].picked.monthIndex) && (Day == Calendar.Config[N].picked.day)){						rclass = 'calendarDayAlready';						}					else {						rclass = 'calendarDay';						}					HTML += '<td align="center" class="' + rclass + '" onClick="Calendar.PickDay(\'' + N +'\', ' + Day + ')">' + Day + '</td>';					}				else{					HTML += '<td class="calendarDayNot">&nbsp</td>';					}				}			HTML += '</tr>';			}		return HTML += '</table>';		},	GetDayCount: function(Year, Month) {		return ((Month == 1) && ((Year % 400 == 0) || ((Year % 4 == 0) && (Year % 100 != 0)))) ? 29 : Calendar.MonthDays[Month];		},	Click: function(Cell, Down) {		if (Down) {			Cell.style.borderLeft = 'buttonshadow 1px solid';			Cell.style.borderTop = 'buttonshadow 1px solid';			Cell.style.borderBottom = 'buttonhighlight 1px solid';			Cell.style.borderRight = 'buttonhighlight 1px solid';			}		else {			Cell.style.borderLeft = 'buttonhighlight 1px solid';			Cell.style.borderTop = 'buttonhighlight 1px solid';			Cell.style.borderBottom = 'buttonshadow 1px solid';			Cell.style.borderRight = 'buttonshadow 1px solid';			}		},	Hover: function(Cell, Over){		if (Over) {			Calendar.Click(Cell, false);			}		else {			Cell.style.border = 'buttonface 1px solid';			}		},	FixDayList: function(List, New) {		var Pick = List.selectedIndex + 1;		if (New != List.length){			var Old = List.length;			for (var k=Math.min(New, Old); k < Math.max(New, Old); k++){				(k >= New) ? List.options[New] = null : List.options[k] = new Option(k+1, k+1);				}			Pick = Math.min(Pick, New);			List.options[Pick-1].selected = true;			}		return Pick;		},	FixYearInput: function(Year){		var YearRE = new RegExp('\\d{' + Year.defaultValue.length + '}');		if (!YearRE.test(Year.value)) Year.value = Year.defaultValue;		},	Timer: {		Start: function(N){			try{				clearTimeout(Calendar.Config[N].timerID);				}			catch(e){}			Calendar.Config[N].timerID = Timer.set(function(){Calendar.hide(N);}, 500);			},		Cancel: function(N){			try{				clearTimeout(Calendar.Config[N].timerID);				}			catch(e){}			}		},	show: function(N){		Calendar.getCalendar(N).style.zIndex = ++Calendar.Config[N].ZCounter;		Calendar.getCalendar(N).style.visibility = 'visible';		},	hide: function(N){		Calendar.Timer.Cancel(N);		Calendar.getCalendar(N).style.zIndex = --Calendar.Config[N].ZCounter;		Calendar.getCalendar(N).style.visibility = 'hidden';		},	showhide: function(N){		if (Calendar.isShowing(N)){			Calendar.Timer.Cancel(N);			Calendar.getCalendar(N).style.zIndex = --Calendar.Config[N].ZCounter;			Calendar.getCalendar(N).style.visibility = 'hidden';			}		else {			Calendar.getCalendar(N).style.zIndex = ++Calendar.Config[N].ZCounter;			Calendar.getCalendar(N).style.visibility = 'visible';			}		},	CheckMonthChange: function(N, MonthList) {		var MonthPick = MonthList.options[MonthList.selectedIndex].value;		var DayList = Calendar.getDayList(N);		var DayPick = Calendar.FixDayList(DayList, Calendar.GetDayCount(Calendar.Config[N].picked.yearValue, MonthPick));		Calendar.PickMonth(N, Calendar.Config[N].picked.yearValue, MonthPick , DayPick);		},	CheckDayChange: function(N, DayList){		Calendar.PickMonth(N, Calendar.Config[N].picked.yearValue, Calendar.Config[N].picked.monthIndex, DayList.selectedIndex+1);		},	CheckYearChange: function(N, Year){		if (Year.value.length == 4){			var NewYear = Year.value;			}		else if (Year.value.length == 2){			var Mill = (Year.value < 76) ? 2000 : 1900;			var NewYear = Mill + parseInt(Year.value, 10);			}		else {			Year.value = Year.defaultValue;			Console.error('Calendar.CheckYearChange: Invalid Year! Please use 4 digit or 2 digit years.');			}		var MonthList = Calendar.getMonthList(N);		var DayList = Calendar.getDayList(N);		var MonthPick = Calendar.Config[N].picked.monthIndex;		var NewDay = Calendar.FixDayList(DayList, Calendar.GetDayCount(NewYear, MonthPick));		Calendar.PickMonth(N, NewYear, MonthPick, NewDay);		Year.defaultValue = Year.value;		},	MonthProps: function(N, Format, Year, Month, Day){		this.date = new Date(Year, Month, Day);		this.yearValue = this.date.getFullYear();		this.monthIndex = this.date.getMonth();		this.monthName = Calendar.Months[this.monthIndex];		this.fullName = this.monthName + ' ' + this.yearValue;		this.day = this.date.getDate();		this.dayCount = Calendar.GetDayCount(this.yearValue, this.monthIndex);		var FirstDate = new Date(this.yearValue, this.monthIndex, 1);		this.firstDay = FirstDate.getDay();		this.yearPad = this.yearValue.toString();		this.monthPad = (this.monthIndex < 9) ? '0' + String(this.monthIndex + 1) : this.monthIndex + 1;		this.dayPad = (this.day < 10) ? '0' + this.day.toString() : this.day;		this.monthShort = this.monthName.substr(0,3).toUpperCase();		if (Format.indexOf('YYYY') == -1){			this.yearPad = this.yearPad.substr(2);			}		if (Format.indexOf('/') >= 0){			var Delimiter = '/';			}		else if (Format.indexOf('-') >= 0){			var Delimiter = '-';			}		else{			var Delimiter = '';			}		if (/DD?.?((MON)|(MM?M?))/.test(Format)) {			this.formatted = this.dayPad + Delimiter;			this.formatted += (RegExp.$1.length == 3) ? this.monthShort : this.monthPad;			}		else if (/((MON)|(MM?M?))?.?DD?/.test(Format)) {			this.formatted = (RegExp.$1.length == 3) ? this.monthShort : this.monthPad;			this.formatted += Delimiter + this.dayPad;			}		this.formatted = (Format.substr(0,2) == 'YY') ? this.yearPad + Delimiter + this.formatted : this.formatted + Delimiter + this.yearPad;		},	LinkProps: function(N, LinkName){		if(arguments.length == 5){			this.date = new Date(arguments[2], arguments[3], arguments[4]);			}		if(arguments.length == 3){			this.date = new Date(arguments[2]);			}			this.yearValue = this.date.getFullYear();		this.monthIndex = this.date.getMonth();		this.monthName = Calendar.Months[this.monthIndex];		this.fullName = this.monthName + ' ' + this.yearValue;		this.day = this.date.getDate();		this.dayCount = Calendar.GetDayCount(this.yearValue, this.monthIndex);		var FirstDate = new Date(this.yearValue, this.monthIndex, 1);		this.firstDay = FirstDate.getDay();		this.displayID = Calendar.Config[N].hiddenFieldName + '_' + LinkName + '_ID';		},	SetMonth: function(N, Year, Month){		Calendar.Config[N].displayed = new Calendar.LinkProps(N, 'Current', Year, Month, 1);		Calendar.Config[N].previous = new Calendar.LinkProps(N, 'Previous', Calendar.Config[N].displayed.date.getTime() - 86400000);		Calendar.Config[N].next = new Calendar.LinkProps(N, 'Next', Calendar.Config[N].displayed.date.getTime() + (86400000 * (Calendar.Config[N].displayed.dayCount + 1)));		if (Calendar.Config[N].output == true){			Calendar.getCalendar(N).innerHTML = Calendar.Build(N);			}		},	ChangeMonth: function(N, Month){		if (Month == "Previous"){			Calendar.getCalendar(N).style.zIndex=++Calendar.Config[N].ZCounter;			Calendar.SetMonth(N, Calendar.Config[N].previous.yearValue, Calendar.Config[N].previous.monthIndex);			}		if (Month == "Current"){			Calendar.getCalendar(N).style.zIndex=++Calendar.Config[N].ZCounter;			Calendar.SetMonth(N, Calendar.Today.getFullYear(), Calendar.Today.getMonth());			}		if (Month == "Next"){			Calendar.getCalendar(N).style.zIndex=++Calendar.Config[N].ZCounter;			Calendar.SetMonth(N, Calendar.Config[N].next.yearValue, Calendar.Config[N].next.monthIndex);			}		},	PickMonth: function(N, Year, Month, Day){		Calendar.Config[N].picked = new Calendar.MonthProps(N, 'YYYY/MM/DD', Year, Month, Day);		Calendar.setHidden(N, Calendar.Config[N].picked.formatted);		Calendar.SetMonth(N, Year, Month);		},	Create: function(N, DefaultDate){		var ThisYear = Calendar.Today.getFullYear();		var ThisMonth =  Calendar.Today.getMonth();		var ThisDay = Calendar.Today.getDate();		var ThisDate = new Calendar.MonthProps(N, 'YYYY/MM/DD', ThisYear, ThisMonth, ThisDay);		if(arguments.length < 2){			DefaultDate = ThisDate.formatted; 			}		Calendar.Config[N] = new function(){			this.hiddenFieldName = N;			this.hiddenFieldID = N;			this.monthListID = N + '_Month_ID';			this.dayListID = N + '_Day_ID';			this.yearFieldID = N + '_Year_ID';			this.monthDisplayID = N + '_Current_ID';			this.calendarID = N + '_Calendar';			this.timerID = 0;			this.objName = N + '_Object';			this.format = 'YYYY/MM/DD';			this.output = false;			this.displayed = null;			this.previous = null;			this.next = null;			this.copyright = 'David Tyler';			this.ZCounter = 100;			}		if(DefaultDate.charAt(4) == '/'){			var DefaultYear = DefaultDate.substring(0, 4)*1;			var DefaultMonth = DefaultDate.substring(5, 7)*1-1;			var DefaultDay = DefaultDate.substring(8, 10)*1;			}		else if(DefaultDate.charAt(2) == '/'){			var DefaultYear = DefaultDate.substring(6, 10)*1;			var DefaultMonth = DefaultDate.substring(0, 2)*1-1;			var DefaultDay = DefaultDate.substring(3, 5)*1;			}		else{			Console.error('Calendar.Create: DefaultDate ['+DefaultDate+'] Invalid [YMD or MDY]. Using today as temp default.');			var DefaultYear = ThisYear;			var DefaultMonth = ThisMonth;			var DefaultDay = ThisDays;			}		Calendar.PickMonth(N, DefaultYear, DefaultMonth, DefaultDay);		var InitialDate = Calendar.Config[N].picked.formatted;		with (document){			writeln('<table cellpadding="0" cellspacing="2"><tr class="calendarForm"><td valign="middle"><input type="hidden" id="'+N+'" value="'+InitialDate+'"><select class="calendarMonthInput" id="'+N+'_Month_ID" onChange="Calendar.CheckMonthChange(\''+N+'\', this)">');			for (var i = 0; i < 12; i++) {				Sel = (Calendar.Config[N].picked.monthIndex == i) ? ' selected' : '';				writeln('<option value="'+i+'"'+Sel+'>'+Calendar.Months[i].substr(0,3)+'</option>');				}			writeln('</select></td><td valign="middle"><select class="calendarDayInput" id="'+N+'_Day_ID" onChange="Calendar.CheckMonthChange(\''+N+'\', this)">');			for (var j=1; j<=Calendar.Config[N].picked.dayCount; j++){				Sel = (Calendar.Config[N].picked.day == j) ? ' selected' : '';				writeln('<option'+Sel+'>'+j+'</option>');				}			writeln('</select></td><td valign="middle"><input class="calendarYearInput" type="text" id="'+N+'_Year_ID" size="'+Calendar.Config[N].picked.yearPad.length+'" maxlength="'+Calendar.Config[N].picked.yearPad.length+'" title="Year" value="'+Calendar.Config[N].picked.yearPad+'" onBlur="Calendar.CheckYearChange(\''+N+'\', this)"></td><td valign="middle"><a id="' + N + '_ID_Link" onclick="Calendar.showhide(\''+N+'\')" onMouseOut="Calendar.Timer.Start(\''+N+'\')" popuplink="'+N+'_Calendar"><img src="images/calendar.gif" title="Calendar" border="0"></a></td><td valign="middle"><span style="position:absolute"><div id="'+N+'_Calendar" class="calendarContainer" onMouseOut="Calendar.Timer.Start(\''+N+'\')" onMouseOver="Calendar.Timer.Cancel(\''+N+'\')" popup="'+N+'_Calendar">');			writeln(Calendar.Build(N));			writeln('</div></span></td></tr></table>');			}		Calendar.Config[N].output = true;		}	};var KeyPress = {	init: function(){		KeyPress.event['F2'] = 'Browser.display()';		//KeyPress.event['F9'] = 'Console.last()';		//KeyPress.event['F9'] = 'Console.Prompt()';		// KeyPress.event['all'] = "default";		KeyPress.listen();		},	listen: function(){		if (document.addEventListener){			document.addEventListener('keydown', KeyPress.catchKey, false);			}		else if (document.attachEvent){			document.attachEvent('onkeydown', KeyPress.catchKey);			}		else{			Console.error('KeyPress.listen: Object not supported');			}		},	event: [],	getCode: function(evt){		var keyCode=0; 		if(typeof(evt.keyCode) != 'undefined'){ keyCode=evt.keyCode; }		else if(typeof(evt.which)!='undefined'){ keyCode=evt.which; }		else{ keyCode = "Error"; }		return keyCode;		},	getKey: function(code){		var keys = [];			keys[3] = "Fn + Break";			keys[8] = "Backspace";			keys[9] = "Tab";			keys[13] = "Enter";			keys[16] = "Shift";			keys[17] = "Ctrl";			keys[18] = "Alt";			keys[19] = "Break";			keys[20] = "Caps Lock";			keys[27] = "Escape";			keys[32] = "Space Bar";			keys[33] = "Page Up";			keys[34] = "Page Down";			keys[35] = "End";			keys[36] = "Home";			keys[37] = "Left Arrow";			keys[38] = "Up Arrow";			keys[39] = "Right Arrow";			keys[40] = "Down Arrow";			keys[45] = "Insert";			keys[46] = "Delete";			keys[48] = "0";			keys[49] = "1";			keys[50] = "2";			keys[51] = "3";			keys[52] = "4";			keys[53] = "5";			keys[54] = "6";			keys[55] = "7";			keys[56] = "8";			keys[57] = "9";			keys[59] = "Semi-Colon";			keys[65] = "A";			keys[66] = "B";			keys[67] = "C";			keys[68] = "D";			keys[69] = "E";			keys[70] = "F";			keys[71] = "G";			keys[72] = "H";			keys[73] = "I";			keys[74] = "J";			keys[75] = "K";			keys[76] = "L";			keys[77] = "M";			keys[78] = "N";			keys[79] = "O";			keys[80] = "P";			keys[81] = "Q";			keys[82] = "R";			keys[83] = "S";			keys[84] = "T";			keys[85] = "U";			keys[86] = "V";			keys[87] = "W";			keys[88] = "X";			keys[89] = "Y";			keys[90] = "Z";			keys[91] = "Windows Key";			keys[93] = "Right Click";			keys[107] = "Equals Sign";			keys[109] = "Minus Sign";			keys[112] = "F1";			keys[113] = "F2";			keys[114] = "F3";			keys[115] = "F4";			keys[116] = "F5";			keys[117] = "F6";			keys[118] = "F7";			keys[119] = "F8";			keys[120] = "F9";			keys[121] = "F10";			keys[122] = "F11";			keys[123] = "F12";			keys[144] = "Num Lock";			keys[145] = "Fn Lock";			keys[188] = "Comma";			keys[190] = "Period";			keys[191] = "Forward Slash";			keys[192] = "Tilde";			keys[219] = "Left Bracket";			keys[220] = "Back Slash";			keys[221] = "Right Bracket";			keys[222] = "Single Quotation";		if(keys[code] != keys[0]){			return keys[code];			}		else{			return "an undefined key";			}		},	catchKey: function(evt){		var code = KeyPress.getCode(evt);		var key = KeyPress.getKey(code);		if(defined(KeyPress.event[code])){			eval(KeyPress.event[code]);			}		if(defined(KeyPress.event[key])){			eval(KeyPress.event[key]);;			}		if(defined(KeyPress.event['all'])){			if(KeyPress.event['all'] == 'default'){				Console.notice('You pressed ' + key + ' (Key #' + code + ')');				}			else{				eval(KeyPress.event['all']);				}			}		}	}var Ajax = {	Output: [],	Object: function(){		var temp = false;		try{			return new ActiveXObject("Microsoft.XMLHTTP");			}		catch(e){}		try{			return new XMLHttpRequest();			}		catch(e){			Console.error("Ajax is not Supported");			return null;			}		},	get: function(url, output, notify, onload){		var id = Ajax.Output.length;		Ajax.Output[Ajax.Output.length] = '[LOADING]';		output = $(output);		if(output == false){			Console.error('Ajax.get: Output does not exist');			}		Ajax.Process(id, url, notify, output, onload);		return id;		},	Upload: function(form, output){		form = $(form);		var erro="";		if(form == null || typeof(form)=="undefined") erro += "Form does not exists.\n";		else if(form.nodeName.toLowerCase()!="form") erro += "Value is not a form.\n";		if(erro.length>0){			Console.error("Ajax.Upload:\n"+erro);			return;			}		var iframe = document.createElement("iframe");		iframe.setAttribute("id", "ajax_upload_frame");		iframe.setAttribute("name", "ajax_upload_frame");		iframe.setAttribute("width", "0");		iframe.setAttribute("height", "0");		iframe.setAttribute("border", "0");		iframe.setAttribute("style", "width: 0; height: 0; border: none;");		form.appendChild(iframe);		window.frames['ajax_upload_frame'].name = "ajax_upload_frame";		Event.Add($('ajax_upload_frame'), 'load', function(){ $(output).value = window.frames['ajax_upload_frame'].document.body.innerHTML; Element.remove('ajax_upload_frame'); });		form.setAttribute("target","ajax_upload_frame");		form.setAttribute("action","upload.php");		form.setAttribute("method","post");		form.setAttribute("enctype","multipart/form-data");		form.setAttribute("encoding","multipart/form-data");		form.submit();		},	Process: function(id, url, notify, page_out, onload){		var x = Ajax.Object();		if (x === null){ return false; } 		if(notify == true){			Popup.Note('Loading...');			if(page_out !== null){				page_out.innerHTML = 'Loading Content...';				}			}		x.open("POST", url, true);		x.send(null);		var output = function(x, counter){				if(x.readyState == 4){					if(x.status != 200){						if(notify === true){							if(page_out === null){								Popup.Note(String.unescape(x.responseText));								Timer.set('Popup.Note_close();', 2000);								}							else{								Popup.Note('Loaded!');								Timer.set('Popup.Note_close();', 1000);								}							}						if(page_out !== null){							page_out.innerHTML = 'Error 500: Internal Server Error. Content not Found. [JS > Ajax]';							Element.CheckAllPositions();							}						return false;						}					Ajax.Output[id] = String.unescape(x.responseText);					if(notify === true){						if(page_out === null){							Popup.Note(String.unescape(x.responseText));							Timer.set('Popup.Note_close();', 2000);							}						else{							Popup.Note('Loaded!');							Timer.set('Popup.Note_close();', 1000);							}						}					if(page_out !== null){						page_out.innerHTML = String.unescape(x.responseText);						UponChange();						}					if(onload != null){						Timer.set(onload, 1000);						}					}				else {					counter++;					if(counter == 10){						if(notify === true){							Popup.Note('Error 500b Timeout. [JS > Ajax]');							Timer.set('Popup.Note_close();', 3000);							}						if(page_out !== null){							page_out.innerHTML = 'Error 500b: Internal Server Error. Timeout. [JS > Ajax]';							}						}					else{						Timer.set(function(){output(x, counter);}, 1000);						}					}				}		output(x, 0);		return true;		}	}var WYSIWYG = {	init: function(){		var areas = Element.byAttribute('editor', 'wysiwyg');		for(var i = 0; i < areas.length; i++) WYSIWYG.attach(i, areas[i]);		},	Config: new Array(),	ToolbarList: {		"bold": 		['Bold', 'Bold', 'bold.gif'],		"italic": 		['Italic', 'Italic', 'italics.gif'],		"underline": 	['Underline', 'Underline', 'underline.gif'],		"strikethrough":['Strikethrough', 'Strikethrough', 'strikethrough.gif'],		"seperator": 	['', '', 'seperator.gif'],		"subscript": 	['Subscript', 'Subscript', 'subscript.gif'],		"superscript": 	['Superscript', 'Superscript', 'superscript.gif'],		"justifyleft": 	['Justifyleft', 'Align Left', 'justify_left.gif'],		"justifycenter":['Justifycenter', 'Align Center', 'justify_center.gif'],		"justifyright":	['Justifyright', 'Align Right', 'justify_right.gif'],		"justifyfull":	['Justifyfull', 'Align Justify', 'justify_justify.gif'],		"unorderedlist":['InsertUnorderedList', 'Insert Unordered List','list_unordered.gif'],		"orderedlist":	['InsertOrderedList', 'Insert Ordered List', 'list_ordered.gif'],		"outdent":		['Outdent', 'Outdent', 'indent_left.gif'],		"indent":		['Indent', 'Indent', 'indent_right.gif'],		"cut":			['Cut', 'Cut', 'cut.gif'],		"copy":			['Copy', 'Copy', 'copy.gif'],		"paste":		['Paste', 'Paste', 'paste.gif'],		"forecolor":	['ForeColor', 'Fore Color', 'forecolor.gif'],		"backcolor":	['BackColor', 'Back Color', 'backcolor.gif'],		"undo":			['Undo', 'Undo', 'undo.gif'],		"redo":			['Redo', 'Redo', 'redo.gif'],		"inserttable":	['InsertTable', 'Insert Table', 'insert_table.gif'],		"insertimage":	['InsertImage', 'Insert Image', 'insert_picture.gif'],		"insertlink":	['InsertLink', 'Insert Hyperlink', 'insert_hyperlink.gif'],		"viewSource":	['ViewSource', 'View Source', 'view_source.gif'],		"viewText":		['ViewText', 'View Text', 'view_text.gif'],		"fonts":		['Fonts', 'Select Font', 'select_font.gif'],		"fontsizes":	['Fontsizes', 'Select Size', 'select_size.gif'],		"headings":		['Headings', 'Select Size', 'select_heading.gif'],		"preview":		['Preview', 'Preview', 'preview.gif'],		"print":		['Print', 'Print', 'print.gif'],		"removeformat":	['RemoveFormat', 'Clean Up HTML', 'remove_format.gif'],		"delete": 		['Delete', 'Delete', 'delete.gif'],		"save": 		['Save', 'Save document', 'save.gif'],		"return": 		['Return', 'Return without saving', 'return.gif']		},	getRange: function(sel){		return sel.createRange ? sel.createRange() : sel.getRangeAt(0);		if(Browser.IE) {			if(sel.type == "Control" && range.length == 1){				var newrange = element.parentTextEdit.createTextRange();				newrange.moveToElementText(range(0));				newrange.select();				}			}		return newrange;		},	getEditor: function(n) {		return $("wysiwyg"+n);		},	getEditorWindow: function(n) {		return WYSIWYG.getEditor(n).contentWindow;		},	attach: function(n, element, settings) {		WYSIWYG.Config[n] = new function(){			this.Element = element;			this.TimerID = 0;			this.Width = "500px";			this.Height = "250px";			this.AnchorPathToStrip = "auto";			this.ImagePathToStrip = "auto";			this.Opener = "";			this.ImagePopupFile = "";			this.ImagePopupWidth = 0;			this.ImagePopupHeight = 0;			this.Toolbar = new Array();			this.DropDowns = new Array();			this.Toolbar[0] = new Array("font", "fontsize", "bold", "italic", "underline", "strikethrough", "seperator", "forecolor", "backcolor", "seperator", "justifyleft", "justifycenter", "justifyright", "justifyfull", "seperator", "unorderedlist", "orderedlist", "outdent", "indent");			this.Toolbar[1] = new Array("subscript", "superscript", "seperator", "delete", "cut", "copy", "paste", "seperator", "undo", "redo", "seperator", "inserttable", "insertimage", "insertlink", "seperator", "preview", "print", "seperator", "viewSource");			this.DropDowns['font'] = {				id: "fonts",				command: "FontName",				label: '<font style="font-family:{value};font-size:12px;">{value}</font>',				width: "90px",				elements: new Array("Arial", "Sans Serif", "Tahoma", "Verdana", "Courier New", "Georgia", "Times New Roman", "Impact", "Comic Sans MS")				};			this.DropDowns['fontsize'] = {				id: "fontsizes",				command: "FontSize",				label: '<font size="{value}">Size {value}</font>',				width: "54px",				elements: new Array("1", "2", "3", "4", "5", "6", "7")				};			this.DropDowns['headings'] = {				id: "headings",				command: "FormatBlock",				label: "<{value} style=\"margin:0px;text-decoration:none;font-family:Arial\">{value}</{value}>",				width: "74px",				elements: new Array("H1","H2","H3","H4","H5","H6")				};			};		if(Element.isObject(settings)){			WYSIWYG.Config[n] = Element.merge(WYSIWYG.Config[n], settings);			}		var textarea = WYSIWYG.Config[n].Element;		if(textarea == null){			Console.error('WYSIWYG.attach: Textarea '+textarea.id+' does not exist');			return;			}	    if (Browser.AS || !$ || !document.designMode){   			Console.alert(Browser.Full+' does not support this interactive editor. Please upgrade or switch your browser, then try again.');			return false;			}		textarea.style.display = 'none';		textarea.setAttribute('wysiwyg', n);		if(textarea.style.width){			WYSIWYG.Config[n].Width = textarea.style.width;			}		if(textarea.style.height) {			WYSIWYG.Config[n].Height = textarea.style.height			}		var currentWidth = WYSIWYG.Config[n].Width;		var currentHeight = WYSIWYG.Config[n].Height;		var toolbarWidth = currentWidth;		var ifrmWidth = "100%";		var	ifrmHeight = "100%";		if(currentWidth.search(/%/) == -1) {			toolbarWidth = currentWidth.replace(/px/gi, "");			toolbarWidth = (parseFloat(toolbarWidth) + 2) + "px";			ifrmWidth = currentWidth;			ifrmHeight = currentHeight;			}		var editor = '<div id="wysiwyg_' + n + '_div" style="width:' + currentWidth  +';"><table border="0" cellpadding="0" cellspacing="0" class="wysiwyg_tableTextareaEditor" id="wysiwyg_'+n+'_table" style="width:' + currentWidth  + ';height:' + currentHeight + ';"><tr id="toolbars-bar"><td style="height:22px;vertical-align:top;">';		for (var i=0; i<WYSIWYG.Config[n].Toolbar.length; i++){			var toolbar = WYSIWYG.Config[n].Toolbar[i];			editor += '<table border="0" cellpadding="0" cellspacing="0" class="wysiwyg_toolbar" style="width:100%;" id="wysiwyg_'+n+'_toolbar_' + i + '"><tr><td style="width:6px;"><img src="' + "images/" + 'seperator2.gif" alt="" hspace="3"></td>';			for (var j = 0; j < toolbar.length; j++){				var id = toolbar[j];				var Button = true;				if(WYSIWYG.Config[n].DropDowns[id]){					Button = false;					var dropdown = WYSIWYG.Config[n].DropDowns[id];					id = dropdown.id;					}				var Object = WYSIWYG.ToolbarList[id];				var ButtonID = Object[0];				var ButtonTitle = Object[1];				var ButtonImage = "images/" + Object[2];				var ButtonOver = String.replace(ButtonImage, '.gif', '_on.gif');				var ButtonPop = 'wysiwyg_' + n + '_' + ButtonID + 'Pop';				Element.Preload(ButtonOver);				if (Button == false){					editor += '<td style="width: '+dropdown.width+';"><img onmouseover="this.src=\''+ButtonOver+'\';" onmouseout="this.src=\''+ButtonImage+'\';" src="' + ButtonImage + '" height="20" onclick="WYSIWYG.openDropDown(\''+n+'\',\''+id+'\');" unselectable="on" border="0"><span id="wysiwyg_'+n+'_'+id+'" class="wysiwyg_dropdown" style="width: 145px; display:none; position:absolute; ">';					dropdown.elements.sort();					for (var k = 0; k < dropdown.elements.length; k++) {						var value = dropdown.elements[k];						var label = dropdown.label.replace(/{value}/gi, value);						editor += '<div onclick="WYSIWYG.execute(\''+n+'\',\''+dropdown.command+'\',\''+value+'\')\;" class="wysiwyg_dropdown_option" style="width: 120px;">'+label+'</div>';						}					editor += '</span></td>';					}				else if (id == "seperator") {					editor += '<td style="width: 12px;" align="center"><img src="' + ButtonImage + '" border=0 unselectable="on" width="2" height="18" hspace="2" unselectable="on"></td>';					}				else if (id == "viewSource"){					editor += '<td style="width: 22px;"><span id="HTMLMode' + n + '"><img src="' + ButtonImage +  '" border="0" unselectable="on" title="' + ButtonTitle + '" id="' + ButtonID + '" class="wywiwyg_button" onmouseover="this.src=\'' + ButtonOver + '\';" onmouseout="this.src=\'' + ButtonImage + '\';" onclick="WYSIWYG.execute(\'' + n + '\', \'' + ButtonID + '\');" unselectable="on" width="20" height="20"></span><span id="textMode' + n + '" style="display:none;"><img src="' + "images/" + 'view_text.gif" border="0" unselectable="on" title="viewText" id="ViewText" class="wywiwyg_button" onmouseover="this.src=\'' + "images/" + 'view_text_on.gif\';" onmouseout="this.src=\'' + "images/" + 'view_text.gif\';" onclick="WYSIWYG.execute(\'' + n + '\',\'ViewText\');" unselectable="on"  width="20" height="20"></td>';					}				else {					var onclick = 'WYSIWYG.execute(\''+n+'\', \''+ButtonID+'\');';					var onmouseover = '';					var onmouseout = '';					var content = '';					if (id == "forecolor" || id == "backcolor"){						onclick = 'WYSIWYG.pop_hide_others(\''+ButtonPop+'\');';						onclick += 'Element.showhide(\''+ButtonPop+'\');';						onclick += 'WYSIWYG.pop_preview_color(\''+n+'\', \''+ButtonID+'\', \'current\');';						content = '<span style=\"position:absolute\"><div style="z-index: 10000; width:210px" align="left" id="'+ButtonPop+'" class="wysiwyg_popup">' + WYSIWYG.pop_insertColorCode(n, ButtonID) + '</div></span>';						}					else if (id == "inserttable"){						onclick = 'WYSIWYG.pop_hide_others(\''+ButtonPop+'\');';						onclick += 'Element.showhide(\''+ButtonPop+'\');';						content = '<span style=\"position:absolute\"><div style="z-index: 10000; width:410px" align="left" id="'+ButtonPop+'" class="wysiwyg_popup">'+WYSIWYG.pop_insertTableCode(n)+'</div></span>';						}					else if (id == "insertimage"){						onclick = 'WYSIWYG.pop_hide_others(\''+ButtonPop+'\');';						onclick += 'Element.showhide(\''+ButtonPop+'\');';						onclick += 'WYSIWYG.pop_loadImage(\''+n+'\');';						content = '<span style=\"position:absolute\"><div style="z-index: 10000; width:410px" align="left" id="'+ButtonPop+'" class="wysiwyg_popup">'+WYSIWYG.pop_insertImageCode(n)+'</div></span>';						}					else if (id == "insertlink"){						onclick = 'WYSIWYG.pop_hide_others(\''+ButtonPop+'\');';						onclick += 'Element.showhide(\''+ButtonPop+'\');';						onclick += 'WYSIWYG.pop_loadLink(\''+n+'\');';						content = '<span style=\"position:absolute\"><div style="z-index: 10000; width:410px" align="left" id="'+ButtonPop+'" class="wysiwyg_popup">'+WYSIWYG.pop_insertLinkCode(n)+'</div></span>';						}					editor += '<td style="width: 22px;"><img src="'+ButtonImage+'" border=0 unselectable="on" width="20" height="20" title="'+ButtonTitle+'" id="'+ButtonID+'" class="wywiwyg_button" onmouseover="'+onmouseover+' this.src=\''+ButtonOver+'\';" onclick="'+onclick+'" onmouseout="'+onmouseout+' this.src=\''+ButtonImage+'\';">'+content+'</td>';					}				}			editor += '<td>&nbsp;</td></tr></table>';			}		editor += '</td></tr><tr id="wysiwyg_edit_box"><td valign="top"><iframe frameborder="0" id="wysiwyg' + n + '" class="wysiwyg_iframeText" style="width:100%;height:' + currentHeight + ';"></iframe></td></tr><tr><td class="wysiwyg_statusbar" style="height:10px;" id="wysiwyg_'+n+'_statusbar">&nbsp;</td></tr></table></div>';		textarea.insertAdjacentHTML("afterEnd", editor);		WYSIWYG.Config[n].viewTextMode = false;		var content = textarea.value;		var doc = WYSIWYG.getEditorWindow(n).document;		doc.open();		doc.write(content);		doc.close();		if (doc.body.contentEditable){			doc.body.contentEditable = true;			}		else {			doc.designMode = "on";			}		WYSIWYG.Highlight.enable(n);		Event.Add(doc, "mouseover", function xa(){			try{				WYSIWYG.closeDropDowns(n);				WYSIWYG.Timer.Start(n);				}			catch(e){}			});		Event.Add($('wysiwyg_'+n+'_InsertTablePop'), "mouseover", function xba(){			try{				WYSIWYG.Timer.Cancel(n);				}			catch(e){}			});		Event.Add($('wysiwyg_'+n+'_InsertImagePop'), "mouseover", function xbb(){			try{				WYSIWYG.Timer.Cancel(n);				}			catch(e){}			});		Event.Add($('wysiwyg_'+n+'_InsertLinkPop'), "mouseover", function xbc(){			try{				WYSIWYG.Timer.Cancel(n);				}			catch(e){}			});		Event.Add(doc, "mouseup", function xc(){			WYSIWYG.updateStatusBar(n);			});		WYSIWYG.ContextMenu.init(n);		},	Timer: {		Start: function(n){			try{				clearTimeout(WYSIWYG.Config[n].TimerID);				}			catch(e){}			WYSIWYG.Config[n].TimerID = Timer.set(function(){WYSIWYG.pop_hide_others('t');}, 500);			},		Cancel: function(n){			try{				clearTimeout(WYSIWYG.Config[n].TimerID);				}			catch(e){}			}		},	getNodeTree: function(n){		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		var tag = WYSIWYG.getTag(range);		if(tag == null) return null;		var node = WYSIWYG.getParent(tag);		var nodeTree = new Array(tag);		var ii = 1;		while(node != null && node.nodeName != "#document"){			nodeTree[ii] = node;			node = WYSIWYG.getParent(node);			ii++;			}		return nodeTree;		},	removeNode: function(n) {		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		var tag = WYSIWYG.getTag(range);		var parent = tag.parentNode;		if(tag == null || parent == null) { return; }		if(tag.nodeName == "HTML" || tag.nodeName == "BODY") { return; }		var childNodes = new Array();		for(var i=0; i < tag.childNodes.length; i++) childNodes[i] = tag.childNodes[i];		for(var i=0; i < childNodes.length; i++) parent.insertBefore(childNodes[i], tag);		parent.removeChild(tag);		if(parent.nodeName == "A" && !parent.hasChildNodes()) {			if(parent.parentNode) parent.parentNode.removeChild(parent);			}		WYSIWYG.updateStatusBar(n);		},	getSelection: function(n) {		var ifrm = WYSIWYG.getEditorWindow(n);		var doc = ifrm.document;		var sel = null;		if(ifrm.getSelection){			sel = ifrm.getSelection();		 }		else if (doc.getSelection) {			sel = doc.getSelection();		}		else if (doc.selection) {			sel = doc.selection;		}		else{			Console.warning('Failed to get Selection');			}		return sel;		},	clearSelection: function(n) {		var ifrm = WYSIWYG.getEditorWindow(n);		var doc = ifrm.document;		if(ifrm.getSelection){			ifrm.getSelection().collapseToStart();			}		else if (doc.getSelection) {			doc.getSelection().collapseToStart();			}		else if (doc.selection) {			doc.selection.empty();			}		else{			Console.warning('Failure to clear Selection');			}		return null;		},	updateStatusBar: function(n) {		var nodeTree = WYSIWYG.getNodeTree(n);		if(nodeTree == null) return null;		var outputTree = "";		var max = nodeTree.length - 1;		for(var i=max; i>=0; i--) {			if(nodeTree[i].nodeName != "HTML" && nodeTree[i].nodeName != "BODY"){				outputTree += '<a class="wysiwyg_statusbar-item" href="javascript:WYSIWYG.selectNode(\''+n+'\','+i+');">' + nodeTree[i].nodeName + '</a>';				}			else {				outputTree += nodeTree[i].nodeName;				}			if(i > 0) outputTree += " > ";			}		var statusbar = $("wysiwyg_"+n+"_statusbar");		if(statusbar) statusbar.innerHTML = outputTree;		},	execute: function(n, cmd, value) {		WYSIWYG.getEditorWindow(n).focus();		if(WYSIWYG.Config[n].viewTextMode && cmd != "ViewText" && cmd != "Print") {			Console.alert("You are in HTML Mode. This feature has been disabled.");		  	return;		} 		var toHexColor = (Browser.IE) ? String.decToRgb : String.toHexColor;		switch(cmd) {			case "RemoveImage": 			WYSIWYG.removeImage(n);			break;			case "RemoveLink": 				WYSIWYG.removeLink(n);			break;			case "RemoveNode": 				WYSIWYG.removeNode(n);			break;			case "ViewSource": 				WYSIWYG.viewSource(n);			break;			case "ViewText": 				WYSIWYG.viewText(n);			break;			case "RemoveFormat":			WYSIWYG.removeFormat(n);			break;			case "Preview":					Console.alert('The Preview Feature has been temporally disabled due to a bug in some browsers. Please use the graphical view of the editor to test the layout of your pages.');			break;			case "Print":				if(document.print){					WYSIWYG.getEditorWindow(n).print();					}				else{					var doc = WYSIWYG.getEditorWindow(n).document;					doc.focus();					var WebBrowser = '<object id="WebBrowser1" width="0" height="0" classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>';					doc.body.insertAdjacentHTML('beforeEnd',WebBrowser);					WebBrowser.ExecWB(6, 2);					WebBrowser.outerHTML = '';					}			break;			case "Return":					location.replace(WYSIWYG.Config[n].Opener);			break;			default:				if(cmd.indexOf('popup_returning_') != -1){					cmd = cmd.replace('popup_returning_', '', 'g');					}				if(cmd == "FormatBlock"){					value = "<" + value + ">";					}				if(!defined(value)){					value = null;					}				if(Browser.FF){					if(cmd == 'BackColor'){						cmd = 'HiliteColor';						}					if(cmd == "Cut" || cmd == "Paste" || cmd == "Copy"){						try {							WYSIWYG.getEditorWindow(n).document.execCommand(cmd, false, value);							}						catch(e) {							if(confirm("Firefox is blocking Copy/Paste from the editor but you can still use these actions from the Edit Menu\n\nWould you like information on how to enable Copy/Paste within the editor?")){								window.open('http://mozilla.org/editor/midasdemo/securityprefs.html');								}							}						}					}				try{					WYSIWYG.getEditorWindow(n).document.execCommand(cmd, false, value);					WYSIWYG.clearSelection(n);					}				catch(e){}			}		WYSIWYG.closeDropDowns(n);		},	insertHTML: function(html, n) {		if (Browser.IE) {	  			WYSIWYG.getEditorWindow(n).document.selection.createRange().pasteHTML(html);   			} 		else {			var span = WYSIWYG.getEditorWindow(n).document.createElement("span");			span.innerHTML = html;			WYSIWYG.insertNodeAtSelection(span, n);					}		},	insertNodeAtSelection: function(insertNode, n) {		var doc = WYSIWYG.getEditorWindow(n).document;		var sel = WYSIWYG.getSelection(n);		var range = sel.getRangeAt(0);		sel.removeAllRanges();		range.deleteContents();		var container = range.startContainer;		var pos = range.startOffset;		range = doc.createRange();		if (container.nodeType==3 && insertNode.nodeType==3) {								container.insertData(pos, insertNode.data);			range.setEnd(container, pos+insertNode.length);			range.setStart(container, pos+insertNode.length);					} 			else {			var afterNode;				var beforeNode;			if (container.nodeType==3) {				var textNode = container;				container = textNode.parentNode;				var text = textNode.nodeValue;				var textBefore = text.substr(0,pos);				var textAfter = text.substr(pos);				beforeNode = document.createTextNode(textBefore);				afterNode = document.createTextNode(textAfter);				container.insertBefore(afterNode, textNode);				container.insertBefore(insertNode, afterNode);				container.insertBefore(beforeNode, insertNode);				container.removeChild(textNode);				} 			else {				try {					afterNode = container.childNodes[pos];					if(defined(afterNode)){						container.insertBefore(insertNode, afterNode);						range.setEnd(afterNode, 0);						range.setStart(afterNode, 0);						}					else{						container.appendChild(insertNode);						range.selectNode(insertNode);						}					}				catch(e){					Console.error('WYSIWYG.insertNodeAtSelection: Failed to set Range '+e+'[Parameters: afterNode='+afterNode+']');					}				}			}		sel.addRange(range);		},	closeDropDowns: function(n, exclude) {		try{			if(!defined(exclude)){				exclude = "";				}			var dropdowns = WYSIWYG.Config[n].DropDowns;			for (i in dropdowns){				if(dropdowns[i].id != exclude) {					if($('wysiwyg_'+n+'_'+dropdowns[i].id)){						$('wysiwyg_'+n+'_'+dropdowns[i].id).style.display = 'none';						}					}				}			}		catch(e){			Console.error('WYSIWYG.closeDropDowns: '+e);			}		},	openDropDown: function(n, id){		var divId = 'wysiwyg_'+n+'_'+id;		$(divId).style.display = ($(divId).style.display == 'none') ? 'block':'none';		WYSIWYG.closeDropDowns(n, id);		},	viewSource: function(n) {		WYSIWYG.Highlight.disable(n);		var doc = WYSIWYG.getEditorWindow(n).document;		var HTML = doc.body.innerHTML;		HTML = WYSIWYG.stripURLPath(n, HTML);		HTML = String.rgbToHex(HTML);	    HTML = document.createTextNode(HTML);	    doc.body.innerHTML = "";	    doc.body.appendChild(HTML);		if($('HTMLMode' + n)){		    $('HTMLMode' + n).style.display = 'none'; 			}	    if($('textMode' + n)){		    $('textMode' + n).style.display = 'block';			}					doc.body.style.fontSize = "12px";		doc.body.style.fontFamily = "Courier New";	  	WYSIWYG.Config[n].viewTextMode = true;		$("wysiwyg_"+n+"_statusbar").style.display = "none";		},	viewText: function(n) { 		var doc = WYSIWYG.getEditorWindow(n).document;  	 		if (Browser.IE) {	    	var iText = doc.body.innerText;			iText = WYSIWYG.stripURLPath(n, iText);			iText = String.rgbToHex(iText);	    	doc.body.innerHTML = iText;		}	  	  	else {	    	var html = doc.body.ownerDocument.createRange();	    	html.selectNodeContents(doc.body);			html = String.rgbToHex(html.toString());	    	doc.body.innerHTML = html;		}		WYSIWYG.Highlight.enable(n);		if($('textMode' + n)){			$('textMode' + n).style.display = 'none'; 		}		if($('HTMLMode' + n)){			$('HTMLMode' + n).style.display = 'block';		}		doc.body.style.fontSize = "";		doc.body.style.fontFamily = ""; 		WYSIWYG.Config[n].viewTextMode = false;		$('wysiwyg_'+n+'_statusbar').style.display = "";		},	stripURLPath: function(n, content, exact) {		if(Browser.IE){			if(!defined(exact)) exact = true;			var stripImgageUrl = null;			var stripAnchorUrl = null;			if(WYSIWYG.Config[n].AnchorPathToStrip == "auto") {				stripAnchorUrl = WYSIWYG.getDocumentUrl(document);				}			else if(WYSIWYG.Config[n].AnchorPathToStrip != "") {				stripAnchorUrl = WYSIWYG.Config[n].AnchorPathToStrip;				}			if(WYSIWYG.Config[n].ImagePathToStrip == "auto") {				stripImgageUrl = WYSIWYG.getDocumentUrl(document);				}			else if(WYSIWYG.Config[n].ImagePathToStrip != "") {				stripImgageUrl = WYSIWYG.Config[n].ImagePathToStrip;				}			var url;			var regex;			var result;			if (stripImgageUrl) {				url = String.toRegex(WYSIWYG.getDocumentPathOfUrl(stripImgageUrl));				if(exact) {					regex = eval("/(src=\")(" + url + ")([^\"]*)/gi");					content = content.replace(regex, "$1$3");					}				else {					regex = eval("/(" + url + ")(.+)/gi");					content = content.replace(regex, "$2");					}				result = WYSIWYG.getDocumentPathOfUrl(stripImgageUrl).match(/.+[\/]{2,3}[^\/]*/,"");				if(result) {					url = String.toRegex(result[0]);					if(exact) {						regex = eval("/(src=\")(" + url + ")([^\"]*)/gi");						content = content.replace(regex, "$1$3");					}					else {						regex = eval("/(" + url + ")(.+)/gi");						content = content.replace(regex, "$2");							}					}				}			if (stripAnchorUrl) {				url = String.toRegex(WYSIWYG.getDocumentPathOfUrl(stripAnchorUrl));				if(exact) {					regex = eval("/(href=\")(" + url + ")([^\"]*)/gi");					content = content.replace(regex, "$1$3");					}				else {					regex = eval("/(" + url + ")(.+)/gi");					content = content.replace(regex, "$2");					}				result = WYSIWYG.getDocumentPathOfUrl(stripAnchorUrl).match(/.+[\/]{2,3}[^\/]*/,"");				if(result) {					url = String.toRegex(result[0]);					if(exact) {						regex = eval("/(href=\")(" + url + ")([^\"]*)/gi");						content = content.replace(regex, "$1$3");						}					else {						regex = eval("/(" + url + ")(.+)/gi");						content = content.replace(regex, "$2");						}					}				url = String.toRegex(stripAnchorUrl);				if(exact) {					regex = eval("/(href=\")(" + url + ")(#[^\"]*)/gi");					content = content.replace(regex, "$1$3");					}				else {					regex = eval("/(" + url + ")(.+)/gi");					content = content.replace(regex, "$2");					}				url = WYSIWYG.getDocumentUrl(document);				var pos = url.lastIndexOf("/");				if(pos != -1) {					url = url.substring(pos + 1, url.length);					url = String.toRegex(url);					if(exact) {						regex = eval("/(href=\")(" + url + ")(#[^\"]*)/gi");						content = content.replace(regex, "$1$3");						}					else {						regex = eval("/(" + url + ")(.+)/gi");						content = content.replace(regex, "$2");						}					}				}			}		return content;		},	updateTextArea: function(n) {		if(WYSIWYG.Config[n].viewTextMode) {			WYSIWYG.viewText(n);			}		WYSIWYG.Highlight.disable(n);		var content = WYSIWYG.getEditorWindow(n).document.body.innerHTML;		content = WYSIWYG.stripURLPath(n, content);		content = String.rgbToHex(content);		Element.byAttribute('wysiwyg', n)[0].value = content;		WYSIWYG.Highlight.enable(n);		},	updateById: function(id){		try{			WYSIWYG.updateTextArea($(id).getAttribute('wysiwyg'));			}		catch(e){}		},	removeFormat: function(n){		if (!confirm("Warning: This action can not be undone and may remove some good formatting. Please save work before proceding. Would you like to continue cleaning up code?")){			return;			}		var doc = WYSIWYG.getEditorWindow(n).document;		var str = doc.body.innerHTML;		str = str.replace(/<span([^>])*>(&nbsp;)*\s*<\/span>/gi, '');	    str = str.replace(/<span[^>]*>/gi, '');	    str = str.replace(/<\/span[^>]*>/gi, '');	    str = str.replace(/<p([^>])*>(&nbsp;)*\s*<\/p>/gi, '');	    str = str.replace(/<p[^>]*>/gi, '');	    str = str.replace(/<\/p[^>]*>/gi, '');	    str = str.replace(/<h([^>])[0-9]>(&nbsp;)*\s*<\/h>/gi, '');	    str = str.replace(/<h[^>][0-9]>/gi, '');	    str = str.replace(/<\/h[^>][0-9]>/gi, ''); 		str = str.replace(/<B [^>]*>/ig, '<b>');		str = str.replace(/<DIV[^>]*>/ig, '');		str = str.replace(/<\/DIV>/gi, '');		str = str.replace(/<[\/\w?]+:[^>]*>/ig, '');		str = str.replace(/(&nbsp;){2,}/ig, '&nbsp;');		str = str.replace(/<STRONG>/ig, '');		str = str.replace(/<\/STRONG>/ig, '');		str = str.replace(/<TT>/ig, '');		str = str.replace(/<\/TT>/ig, '');		str = str.replace(/<FONT [^>]*>/ig, '');		str = str.replace(/<\/FONT>/ig, '');		str = str.replace(/STYLE=\"[^\"]*\"/ig, '');		str = str.replace(/<([\w]+) class=([^ |>]*)([^>]*)/gi, '<$1$3');  	    str = str.replace(/<([\w]+) style="([^"]*)"([^>]*)/gi, '<$1$3'); 		str = str.replace(/width=([^ |>]*)([^>]*)/gi, '');	    str = str.replace(/classname=([^ |>]*)([^>]*)/gi, '');	    str = str.replace(/align=([^ |>]*)([^>]*)/gi, '');	    str = str.replace(/valign=([^ |>]*)([^>]*)/gi, '');	    str = str.replace(/<\\?\??xml[^>]>/gi, '');	    str = str.replace(/<\/?\w+:[^>]*>/gi, '');	    str = str.replace(/<st1:.*?>/gi, '');	    str = str.replace(/o:/gi, ''); 	    str = str.replace(/<!--([^>])*>(&nbsp;)*\s*<\/-->/gi, '');   		str = str.replace(/<!--[^>]*>/gi, '');   		str = str.replace(/<\/--[^>]*>/gi, '');		doc.body.innerHTML = str;		},	findParent: function(parentTagName, range){		parentTagName = parentTagName.toUpperCase();		var rangeWorking;		var elmWorking = null;		try {			if(!Browser.IE) {				var node = range.startContainer;					var pos = range.startOffset;				if(node.nodeType != 3) { node = node.childNodes[pos]; }				return WYSIWYG.findParentNode(parentTagName, node);			}			else {				elmWorking = (range.length > 0) ? range.item(0): range.parentElement();				elmWorking = WYSIWYG.findParentNode(parentTagName, elmWorking);				if(elmWorking != null) return elmWorking;				rangeWorking = range.duplicate();				rangeWorking.collapse(true);				rangeWorking.moveEnd("character", 1);				if (rangeWorking.text.length>0) {					while (rangeWorking.compareEndPoints("EndToEnd", range) < 0){			  			rangeWorking.move("Character");			  			if (null != WYSIWYG.findParentTag(parentTagName, rangeWorking)){			   				return WYSIWYG.findParentTag(parentTagName, rangeWorking);							}						}					}			 	return null;				}			}		catch(e) {			return null;			}		},	getTag: function(range) {		try {		    if(!Browser.IE) {				var node = range.startContainer;					var pos = range.startOffset;				if(node.nodeType != 3) { node = node.childNodes[pos]; }								if(node.nodeName && node.nodeName.search(/#/) != -1) {					return node.parentNode;				}				return node;			}			else {				if(range.length > 0) {					return range.item(0);				}				else if(range.parentElement()) {					return range.parentElement();				}			}			return null;		}		catch(e) {			return null;		}		},	getParent: function(element) {		if(element.parentNode) {			return element.parentNode;		}		return null;		},	selectNode: function(n, level) {		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		var parentnode = WYSIWYG.getTag(range);		var i = 0;		for (var node=parentnode; (node && (node.nodeType == 1)); node=node.parentNode) {			if (i == level) {				WYSIWYG.nodeSelection(n, node);			}			i++;		}		WYSIWYG.updateStatusBar(n);		},	nodeSelection: function(n, node) {		var doc = WYSIWYG.getEditorWindow(n).document;		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		if(!Browser.IE){			if (node.nodeName == "BODY") {				range.selectNodeContents(node);				}			else {				range.selectNode(node);				}			if (sel) { sel.removeAllRanges(); }			if (sel) { sel.addRange(range);	 }		}		else {			if ((node.nodeName == "TABLE") || (node.nodeName == "IMG") || (node.nodeName == "INPUT") || (node.nodeName == "SELECT") || (node.nodeName == "TEXTAREA")) {				try {					range = doc.body.createControlRange();					range.addElement(node);					range.select();				} 				catch(e) {					Console.error('WYSIWYG.nodeSelection: '+e+'[Sub0]');					}			} 			else {				range = doc.body.createTextRange();				if (range) {					range.collapse();					if (range.moveToElementText) {						try {							range.moveToElementText(node);							range.select();							}						catch(e) {							try {								range = doc.body.createTextRange();								range.moveToElementText(node);								range.select();								} 							catch(e) {								Console.error('WYSIWYG.nodeSelection: '+e+'[Sub1]');								}							}						}					else {						try {							range = doc.body.createTextRange();							range.moveToElementText(node);							range.select();							} 						catch(e) {							Console.error('WYSIWYG.nodeSelection: '+e+'[Sub2]');							}						}					}				}			}		},	getDocumentPathOfUrl: function(url) {		var path = null;		url = url.replace(/file:\/\//gi, "file:///");		url = url.replace(/\\/gi, "\/");		var pos = url.lastIndexOf("/");		if(pos != -1) path = url.substring(0, pos + 1);		return path;		},	getDocumentUrl: function(doc) {		var url = doc.URL;		url = url.replace(/file:\/\//gi, "file:///");		url = url.replace(/\\/gi, "\/");		return url;		},	findParentNode: function(tagName, node) {		while (node.tagName != "HTML") {	  		if (node.tagName == tagName) return node; 	  		node = node.parentNode;			}	 	return null;		},	getElementPosition: function(elm1, elm2) {		var top = 0, left = 0; 			while (elm1 && elm1 != elm2) {			left += elm1.offsetLeft;			top += elm1.offsetTop;			elm1 = elm1.offsetParent;			}		return {left : left, top : top};		},	pop_hide_others: function(current){		var pops = $$$('wysiwyg_popup');		for(i = 0; i < pops.length; i++){			if(pops[i].id != current) Element.hide(pops[i].id);			}		},	pop_insertColorCode: function(n, popID){		var ret = '<table border="0" cellspacing="0" cellpadding="4" width="210px"><tr><td valign=center><div id="wysiwyg_'+n+'_'+popID+'Pop_previewbox" style="height: 100%; width: 50px; padding: 0px;">&nbsp;</div></td><td valign=center><input type="text" size="15" id="wysiwyg_'+n+'_'+popID+'Pop_preview" style="font-size: 10px;"></td><td width="100%"></td></tr></table><table border=0 cellspacing=1 cellpadding=0 bgcolor="#000000" style="cursor: pointer;">';		var h = '00', e = '00', x = '00', hex = '000000';		var common_colors = new Array('000000','333333','666666','999999','CCCCCC','FFFFFF','FF0000','00FF00','0000FF','FFFF00','00FFFF','FF00FF');		for(var i = 0; i < 12; i++){			ret += '<tr width="210px">';			for(var j = 0; j < 21; j++){				if(i < 6 && j < 9){h = "00";}				if(i < 6 && j > 8 && j < 15){h = "33";}				if(i < 6 && j > 14){h = "66";}				if(i > 5 && j < 9){h = "99";}				if(i > 5 && j > 8 && j < 15){h = "CC";}				if(i > 5 && j > 14){h = "FF";}				if(j == 3 || j == 9 || j == 15){e = "00";} 				if(j == 4 || j == 10 || j == 16){e = "33";} 				if(j == 5 || j == 11 || j == 17){e = "66";} 				if(j == 6 || j == 12 || j == 18){e = "99";} 				if(j == 7 || j == 13 || j == 19){e = "CC";} 				if(j == 8 || j == 14 || j == 20){e = "FF";}				if(i == 0 || i == 6){x = "00";}				if(i == 1 || i == 7){x = "33";}				if(i == 2 || i == 8){x = "66";}				if(i == 3 || i == 9){x = "99";}				if(i == 4 || i == 10){x = "CC";}				if(i == 5 || i == 11){x = "FF";}				if(j == 0 || j == 2){hex = "000000";}				else if(j == 1){hex = common_colors[i];}				else{hex = h+e+x;}				ret += '<td bgcolor="#'+hex+'" onMouseOver="WYSIWYG.pop_preview_color(\''+n+'\', \''+popID+'\', \'#'+hex+'\')" onClick="WYSIWYG.pop_set_color(\''+n+'\', \''+popID+'\', \'#'+hex+'\')" height="10" width="10"></td>';				}			ret += '</tr>';			}		return ret + '</table>';		},	pop_preview_color: function(n, cmd, color){		if(color == 'current'){			var cmd2 = (Browser.FF && cmd == 'BackColor') ? 'HiliteColor': cmd;			var rgb = WYSIWYG.getEditorWindow(n).document.queryCommandValue(cmd2);			var current = rgb != '' ? String.toHexColor(WYSIWYG.getEditorWindow(n).document.queryCommandValue(cmd2)) : "000000";			color = '#'+current;			}		$('wysiwyg_'+n+'_'+cmd+'Pop_preview').value = color;		$('wysiwyg_'+n+'_'+cmd+'Pop_previewbox').style.backgroundColor = color;		},	pop_set_color: function(n, cmd, color){		WYSIWYG.execute(n, 'popup_returning_'+cmd, color);		Element.hide('wysiwyg_'+n+'_'+cmd+'Pop');		},	pop_insertTableCode: function(n){		var id = 'wysiwyg_'+n+'_InsertTablePop';		return '<div class="wysiwyg_pop_title" id="'+id+'_title"></div><table class="wysiwyg_pop_table" align="center" cellpadding="0" cellspacing="0"><tr><td>Rows: <input type="text" id="'+id+'_rows"></td><td>Width: <input type="text" id="'+id+'_width"></td></tr><tr><td>Cols: <input type="text" id="'+id+'_cols"></td><td>Alignment: <select id="'+id+'_align"><option value="">Not Set</option><option value="left">Left</option><option value="right">Right</option><option value="texttop">Texttop</option><option value="absmiddle">Absmiddle</option><option value="baseline">Baseline</option><option value="absbottom">Absbottom</option><option value="bottom">Bottom</option><option value="middle">Middle</option><option value="top">Top</option></select></td></tr><tr><td>Padding: <input type="text" id="'+id+'_padding"></td><td>Background-Color: <input type="text" id="'+id+'_backgroundcolor"><img src="images/backcolor_on.gif" border=0 unselectable="on" width="20" height="20"></td></tr><tr><td>Border-Size: <input type="text" id="'+id+'_borderSize"></td><td>Border-Color: <input type="text" id="'+id+'_borderColor"><img src="'+"images/"+'backcolor_on.gif" border=0 unselectable="on" width="20" height="20"></td></tr><tr><td>Border-Style: <select id="'+id+'_borderStyle" style="width: 80px;"><option value="none">none</option><option value="solid">solid</option><option value="double">double</option><option value="dotted">dotted</option><option value="dashed">dashed</option><option value="groove">groove</option><option value="ridge">ridge</option><option value="inset">inset</option><option value="outset">outset</option></select></td><td>Border-Collapse:</td><td><input type="checkbox" id="'+id+'_borderCollapse"></td></tr></table><div align="right"><input id="'+id+'_submit" type="submit" onClick="WYSIWYG.insertTable(\''+n+'\'); Element.hide(\''+id+'\');">&nbsp;<input type="submit" value="  Cancel  " onClick="Element.hide(\''+id+'\');"></div>';		},	insertTable: function(n) {		var doc = WYSIWYG.getEditorWindow(n).document;		var table = doc.createElement("TABLE");		WYSIWYG.setAttribute(table, "tmpcols", $('wysiwyg_'+n+'_InsertTablePop_cols').value);		WYSIWYG.setAttribute(table, "tmprows", $('wysiwyg_'+n+'_InsertTablePop_rows').value);		if($('wysiwyg_'+n+'_InsertTablePop_alignment').value != ""){			WYSIWYG.setAttribute(table, "align", $('wysiwyg_'+n+'_InsertTablePop_alignment').value);			}		var style = "padding:" + $('wysiwyg_'+n+'_InsertTablePop_padding').value + "px; width:" + $('wysiwyg_'+n+'_InsertTablePop_width').value + $('wysiwyg_'+n+'_InsertTablePop_widthType').value + "; border:" + $('wysiwyg_'+n+'_InsertTablePop_border').value + "px;";		if($('wysiwyg_'+n+'_InsertTablePop_borderstyle').value != "none"){			style += "border-style:" + $('wysiwyg_'+n+'_InsertTablePop_borderstyle').value + ";";			}		if($('wysiwyg_'+n+'_InsertTablePop_bordercolor').value != "none"){			style += "border-color:" + $('wysiwyg_'+n+'_InsertTablePop_bordercolor').value + ";";			}		var collapse = $('wysiwyg_'+n+'_InsertTablePop_bordercollapse').checked ? "true" : "separate";		style += "border-collapse:" + collapse + ";";		if($('wysiwyg_'+n+'_InsertTablePop_backgroundcolor').value != "none"){			style += "background-color:" + $('wysiwyg_'+n+'_InsertTablePop_backgroundcolor').value + ";";			}		WYSIWYG.setAttribute(table, "style", style);		var doc = WYSIWYG.getEditorWindow(n).document;		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		tbl = table;		var rows = WYSIWYG.getAttribute(table, "tmprows");		var cols = WYSIWYG.getAttribute(table, "tmpcols");		WYSIWYG.removeAttribute(table, "tmprows");		WYSIWYG.removeAttribute(table, "tmpcols");		for(var i=0;i<rows;i++) {			var tr = doc.createElement("tr");			for(var j=0;j<cols;j++){				var td = doc.createElement("td");				td.innerHTML = "&nbsp;";				tr.appendChild(td);					}			tbl.appendChild(tr);			}		if (Browser.IE) range.pasteHTML(tbl.outerHTML);		else WYSIWYG.insertNodeAtSelection(tbl, n);		WYSIWYG.Highlight.enable(n);		},	pop_insertImageCode: function(n){		var id = 'wysiwyg_'+n+'_InsertImagePop';		return '<div class="wysiwyg_pop_title" id="'+id+'_title"></div><table class="wysiwyg_pop_table" align="center" cellpadding="0" cellspacing="0"><tr><td colspan="2">Image URL: <input type="text" id="'+id+'_src" style="width: 100%"></td></tr><tr><td colspan="2">Alternate Text: <input type="text" id="'+id+'_alt" style="width: 100%"></td></tr><tr><td>Width: <input type="text" id="'+id+'_width"></td><td>Alignment: <select id="'+id+'_align"><option value="">Not Set</option><option value="left">Left</option><option value="right">Right</option> <option value="texttop">Texttop</option><option value="absmiddle">Absmiddle</option> <option value="baseline">Baseline</option><option value="absbottom">Absbottom</option> <option value="bottom">Bottom</option><option value="middle">Middle</option> <option value="top">Top</option></select> </td></tr><tr><td>Height: <input type="text" id="'+id+'_height"></td><td>Horizontal Space: <input type="text" id="'+id+'_hspace"></td></tr><tr><td>Border: <input type="text" id="'+id+'_border" value="0"></td><td>Vertical Space: <input type="text" id="'+id+'_vspace"></td></tr></table><div align="right"><input id="'+id+'_submit" type="submit" onClick="WYSIWYG.insertImage(\''+n+'\'); Element.hide(\''+id+'\');">&nbsp;<input type="submit" value="  Cancel  " onClick="Element.hide(\''+id+'\');"></div>'; 		},	insertImage: function(n) {		var id = 'wysiwyg_'+n+'_InsertImagePop';		var src = $(id+'_src').value;		var alt = $(id+'_alt').value;		var width = $(id+'_width').value;		var height = $(id+'_height').value;		var border = $(id+'_border').value;		var align = $(id+'_align').value;		var vspace = $(id+'_vspace').value;		var hspace = $(id+'_hspace').value;		if(Browser.IE) {			width = width.replace(/px/, "");			height = height.replace(/px/, "");			}		var doc = WYSIWYG.getEditorWindow(n).document;		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		var img = WYSIWYG.findParent("img", range);		var update = (img == null) ? false : true;		if (!update) img = doc.createElement("img");		WYSIWYG.setAttribute(img, "src", src);		WYSIWYG.setAttribute(img, "style", "width:" + width + ";height:" + height);		if(align != "") WYSIWYG.setAttribute(img, "align", align);		else img.removeAttribute("align");		WYSIWYG.setAttribute(img, "border", border);		WYSIWYG.setAttribute(img, "alt", alt);		WYSIWYG.setAttribute(img, "hspace", hspace);		WYSIWYG.setAttribute(img, "vspace", vspace);		img.removeAttribute("width");		img.removeAttribute("height");		if(update == false){   			if (Browser.IE){				range.pasteHTML(img.outerHTML);   				}			else {				WYSIWYG.insertNodeAtSelection(img, n);				}			}		},	pop_loadImage: function(n){		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		var img = WYSIWYG.findParent("img", range);		var id = 'wysiwyg_'+n+'_InsertImagePop';		if (img == null && $(id+'_title').innerHTML != 'Insert a New Image:'){			$(id+'_src').value = 'http://';			$(id+'_alt').value = '';			$(id+'_align').options[0].selected;			$(id+'_border').value = '0px';			$(id+'_hspace').value = '0px';			$(id+'_vspace').value = '0px';			$(id+'_width').value = '';			$(id+'_height').value = '';			$(id+'_submit').value = '  Insert Image  ';			$(id+'_title').innerHTML = 'Insert a New Image:';			}		if (img == null){			return false;			}		$(id+'_submit').value = '  Update Image  ';		$(id+'_title').innerHTML = 'Update this Image:';		for(var i = 0; i < img.attributes.length; i++) {			var attr = img.attributes[i].name.toLowerCase();			var value = img.attributes[i].value;			if(attr && value && value != "null") {				switch(attr) {					case "src": 						value = WYSIWYG.stripURLPath(n, value, false);						$(id+'_src').value = value;					break;					case "alt":						$(id+'_alt').value = value;					break;					case "align":						var element = $(id+'_align');						if(element.options.length) {							for(var i=0;i<element.options.length;i++) {								if(element.options[i].value == value) {									element.options[i].selected = true;									}								}							}					break;					case "border":						$(id+'_border').value = value;					break;					case "hspace":						$(id+'_hspace').value = value;					break;					case "vspace":						$(id+'_vspace').value = value;					break;					case "width":						$(id+'_width').value = value;					break;					case "height":						$(id+'_height').value = value;					break;									}				}			}		return true;		},	pop_insertLinkCode: function(n){		var id = 'wysiwyg_'+n+'_InsertLinkPop';		return '<div class="wysiwyg_pop_title" id="'+id+'_title"></div><table class="wysiwyg_pop_table" align="center" cellpadding="0" cellspacing="0"><tr><td colspan="2">URL: <input type="text" id="'+id+'_src" style="width: 100%"></td></tr><tr><td colspan="2">Target:<div style="padding: 0px"><input type="text" id="'+id+'_target" onchange="WYSIWYG.pop_updateTargetSelect(\''+n+'\', this.value)" style="width: 75%;">&nbsp;<select id="'+id+'_targetChooser" onchange="WYSIWYG.pop_updateTargetBox(\''+n+'\', this.value);"><option value="" selected>no target</option><option value="_blank">_blank</option> <option value="_self">_self</option> <option value="_parent">_parent</option><option value="_top">_top</option><option value="">custom</option></select></div></td></tr><tr><td>Style: <input type="text" id="'+id+'_style" style="width: 100%"></td></tr></table><div align="right"><input id="'+id+'_submit" type="submit" onClick="WYSIWYG.insertLink(\''+n+'\'); Element.hide(\''+id+'\');">&nbsp;<input type="submit" value="  Cancel  " onClick="Element.hide(\''+id+'\');"></div>';		},	insertLink: function(n){		var id = 'wysiwyg_'+n+'_InsertLinkPop';		var href = $(id+'_src').value;		var target = $(id+'_target').value;		var style = $(id+'_style').value;		//var class = $(id+'_class').value;		//var name = $(id+'_name').value;		var doc = WYSIWYG.getEditorWindow(n).document;		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		var link = WYSIWYG.findParent("a", range);		var update = (link == null) ? false : true;		if (!update) link = doc.createElement("a");		WYSIWYG.setAttribute(link, "href", href);		//WYSIWYG.setAttribute(link, "class", class);		//WYSIWYG.setAttribute(link, "className", class);		WYSIWYG.setAttribute(link, "target", target);		//WYSIWYG.setAttribute(link, "name", name);		WYSIWYG.setAttribute(link, "style", style);		if (update) return false;		if (Browser.IE) {			range.select();			link.innerHTML = range.htmlText;			range.pasteHTML(link.outerHTML);   			} 		else {			var node = range.startContainer;			var pos = range.startOffset;			if(node.nodeType != 3) node = node.childNodes[pos];			if(node.tagName) link.appendChild(node);			else link.innerHTML = sel;			WYSIWYG.insertNodeAtSelection(link, n);			}		return true;		},	pop_loadLink: function(n){		var id = 'wysiwyg_'+n+'_InsertLinkPop';		var sel = WYSIWYG.getSelection(n);		var range = WYSIWYG.getRange(sel);		var link = WYSIWYG.findParent("a", range);		if (link == null && $(id+'_title').innerHTML != 'Insert a New Hyperlink:'){			$(id+'_src').value = 'http://';			$(id+'_target').value = '';			$(id+'_style').value = '';			$(id+'_targetChooser').options[0].selected;			$(id+'_submit').value = '  Insert Link  ';			$(id+'_title').innerHTML = 'Insert a New Hyperlink:';			}		if (link == null){			return false;			}		$(id+'_submit').value = '  Update Link  ';		$(id+'_title').innerHTML = 'Update this Hyperlink:';		for(var i=0; i < link.attributes.length; i++) {			var attr = link.attributes[i].name.toLowerCase();			var value = link.attributes[i].value;			if(attr && value && value != "null") {				switch (attr) {					case "href":						value = WYSIWYG.stripURLPath(n, value, false);						$(id+'_src').value = value;					break;					case "target":						$(id+'_target').value = value;						WYSIWYG.selectItemByValue($(id+'_targetChooser'), value);					break;					/*					case "name":						$(id+'_name').value = value;					break;					case "class":						$(id+'_class').value = value;					break;					case "className":						$(id+'_class').value = value;					break;					*/					}				}			}		$(id+'_style').value = String.rgbToHex(WYSIWYG.getAttribute(link, "style"));		return true;		},	pop_updateTargetBox: function (n, value){		$('wysiwyg_'+n+'_InsertLinkPop_target').value = value;		},	pop_updateTargetSelect: function (n, value){		WYSIWYG.selectItemByValue($('wysiwyg_'+n+'_InsertLinkPop_targetChooser'), value);		},	selectItemByValue: function(element, value) {		if(element.options.length) {			for(var i=0;i<element.options.length;i++) {				if(element.options[i].value == value) {					element.options[i].selected = true;					return;					}				}			element.options[(element.options.length-1)].selected = true;			}		},	Highlight: {		add: function(node){			var style = WYSIWYG.getAttribute(node, "style");			if (style == null || style == ''){				WYSIWYG.removeAttribute(node, "prevstyle");				WYSIWYG.setAttribute(node, "prevstyle", style);				WYSIWYG.setAttribute(node, "style", "border:1px dashed #AAAAAA;");				var style = WYSIWYG.getAttribute(node, "style");				WYSIWYG.setAttribute(node, "compstyle", style);				}			},		remove: function(node){			var style = WYSIWYG.getAttribute(node, "style");			var comp = WYSIWYG.getAttribute(node, "compstyle");			if (style == comp){				var style = WYSIWYG.getAttribute(node, "prevstyle");				WYSIWYG.removeAttribute(node, "prevstyle");				WYSIWYG.removeAttribute(node, "style");				WYSIWYG.removeAttribute(node, "compstyle");				WYSIWYG.setAttribute(node, "style", style);				}			},		enable: function(n){			var doc = WYSIWYG.getEditorWindow(n).document;			var tables = doc.getElementsByTagName("table");			for(var i = 0; i < tables.length; i++) WYSIWYG.Highlight.add(tables[i]);			var tds = doc.getElementsByTagName("td");			for(var i = 0; i < tds.length; i++) WYSIWYG.Highlight.add(tds[i]);		 	},		disable: function(n){			var doc = WYSIWYG.getEditorWindow(n).document;			var tables = doc.getElementsByTagName("table");			for(var i=0; i < tables.length; i++) WYSIWYG.Highlight.remove(tables[i]);			var tds = doc.getElementsByTagName("td");			for(var i=0; i<tds.length; i++) WYSIWYG.Highlight.remove(tds[i]);			}		},	ContextMenu: {		html: "",		contextMenuDiv: null,		init: function(n) {			var doc = WYSIWYG.getEditorWindow(n).document;			this.contextMenuDiv = document.createElement("div");			this.contextMenuDiv.className = "wysiwyg_context-menu-div";			this.contextMenuDiv.setAttribute("class", "wysiwyg_context-menu-div");			this.contextMenuDiv.style.display = "none";			this.contextMenuDiv.style.position = "absolute";			this.contextMenuDiv.style.zIndex = 9999;			this.contextMenuDiv.style.left = "0";			this.contextMenuDiv.style.top = "0";			this.contextMenuDiv.unselectable = "on";			document.body.insertBefore(this.contextMenuDiv, document.body.firstChild);			Event.Add(doc, "contextmenu", function context(e){				WYSIWYG.ContextMenu.show(e, n);				});			Event.Add(doc, "click", function context(e){				WYSIWYG.ContextMenu.close();				});			Event.Add(doc, "keydown", function context(e){				WYSIWYG.ContextMenu.close();				});			Event.Add(document, "click", function context(e){				WYSIWYG.ContextMenu.close();				});			},		show: function(e, n) {			if(this.contextMenuDiv == null) return false;			var ifrm = WYSIWYG.getEditor(n);			var doc = WYSIWYG.getEditorWindow(n).document;			var pos = WYSIWYG.getElementPosition(ifrm);			var x = (Browser.IE) ? pos.left + e.clientX : pos.left + (e.pageX - doc.body.scrollLeft);			var y = (Browser.IE) ? pos.top + e.clientY : pos.top + (e.pageY - doc.body.scrollTop);			this.contextMenuDiv.style.left = x + "px"; 			this.contextMenuDiv.style.top = y + "px";			this.contextMenuDiv.style.visibility = "visible";			this.contextMenuDiv.style.display = "block";			Timer.set("WYSIWYG.ContextMenu.output("+n+")", 10);			Event.Cancel(e);			return false;			},		output: function(n) {			var sel = WYSIWYG.getSelection(n);			var range = WYSIWYG.getRange(sel);			var tag = WYSIWYG.getTag(range);			if(tag == null) return false;			this.clear();			var isImg = (tag.nodeName == "IMG") ? true : false;			var isLink = (tag.nodeName == "A") ? true : false;			var len = 0;			if(Browser.IE){				len = (document.selection && range.text) ? range.text.length : 0;				}			else{				len = range.toString().length;				}			var sel = len != 0 || isImg;			var iconLink = {				enabled: "images/" + WYSIWYG.ToolbarList["insertlink"][3],				disabled: "images/" + WYSIWYG.ToolbarList["insertlink"][2]				};			var iconImage = {				enabled: "images/" + WYSIWYG.ToolbarList["insertimage"][3],				disabled: "images/" + WYSIWYG.ToolbarList["insertimage"][2]				};			var iconDelete = {				enabled: "images/" + WYSIWYG.ToolbarList["delete"][3],				disabled: "images/" + WYSIWYG.ToolbarList["delete"][2]				};			var iconCopy = {				enabled: "images/" + WYSIWYG.ToolbarList["copy"][3],				disabled: "images/" + WYSIWYG.ToolbarList["copy"][2]				};			var iconCut = {				enabled: "images/" + WYSIWYG.ToolbarList["cut"][3],				disabled: "images/" + WYSIWYG.ToolbarList["cut"][2]				};			var iconPaste = {				enabled: "images/" + WYSIWYG.ToolbarList["paste"][3],				disabled: "images/" + WYSIWYG.ToolbarList["paste"][2]				};			this.html += '<table class="wysiwyg_context-menu" border="0" cellpadding="0" cellspacing="0">';			this.addItem(n, 'Copy', iconCopy, 'Copy', sel);			this.addItem(n, 'Cut', iconCut, 'Cut', sel);			this.addItem(n, 'Paste', iconPaste, 'Paste', true);			this.addSeperator();			this.addItem(n, 'InsertImage', iconImage, 'Modify Image Properties...', isImg);			this.addItem(n, 'InsertLink', iconLink, 'Create or Modify Link...', sel || isLink);			this.addItem(n, 'RemoveNode', iconDelete, 'Remove', true);			this.html += '</table>';			this.contextMenuDiv.innerHTML = this.html;			},		close: function() {			this.contextMenuDiv.style.visibility = "hidden";			this.contextMenuDiv.style.display = "none";			},		clear: function() {			WYSIWYG.ContextMenu.contextMenuDiv.innerHTML = "";			WYSIWYG.ContextMenu.html = "";			},		addItem: function(n, cmd, icon, title, disabled) {			Console.log('Adding Command to Menu');			var item = '';			if(disabled) {				item += '<tr><td class="icon"><a onclick="WYSIWYG.execute(\'' + n + '\',\'' + cmd + '\', null);"><img src="' + icon.enabled + '" border="0"></a></td><td onmouseover="this.className=\'mouseover\'" onmouseout="this.className=\'\'" onclick="WYSIWYG.execute(\'' + n + '\', \'' + cmd + '\', null); WYSIWYG.ContextMenu.close(); "><a href="javascript:void(0);">' + title + '</a></td></tr>';				}			else {				item += '<tr><td class="icon"><img src="' + icon.disabled + '" border="0"></td><td onmouseover="this.className=\'mouseover\'" onmouseout="this.className=\'\'"><span class="disabled">' + title + '</span></td></tr>';				}			WYSIWYG.ContextMenu.html += item;			},		addSeperator: function() {			Console.log('Adding Seperator to Menu');			WYSIWYG.ContextMenu.html += '<tr><td colspan="2" style="text-align:center;"><hr size="1" color="#C9C9C9" width="95%"></td></tr>';			}		},	MiniColorPicker: {		COLORS: new Array("#000000","#993300","#333300","#003300","#003366","#000080","#333399","#333333","#800000","#FF6600","#808000","#008000","#008080","#0000FF","#666699","#808080","#FF0000","#FF9900","#99CC00","#339966","#33CCCC","#3366FF","#800080","#999999","#FF00FF","#FFCC00","#FFFF00","#00FF00","#00CCFF","#993366",		"#C0C0C0","#FF99CC","#FFCC99","#FFFF99","#CCFFCC","#CCFFFF","#99CCFF","#666699","#777777","#999999","#EEEEEE","#FFFFFF"),		init: function(){			var div = document.createElement("DIV");			div.id = "colorpicker-div";			div.style.position = "absolute";			div.style.visibility = "hidden";			document.body.appendChild(div);			},		choose: function(element) {			var div = $("colorpicker-div");			if(div == null) {				Console.error("WYSIWYG.MiniColorPicker: Loading failed because element was not created. Please try again.");				return;				}			write(element);			var x = window.event.clientX + document.body.scrollLeft;			var y = window.event.clientY + document.body.scrollTop;			var winwidth = Browser.getWidth();			var winheight = Browser.getHeight();			if(x + div.offsetWidth > winwidth) x = winwidth - div.offsetWidth - 5;			if(y + div.offsetHeight > winheight) y = winheight - div.offsetHeight - 5;			div.style.left = x + "px";			div.style.top = y + "px";			div.style.visibility = "visible";			},		select: function(n, color) {			var div = $("colorpicker-div");			var elm = $(n);			elm.value = color;			elm.style.color = color;			elm.style.backgroundColor = color;			div.style.visibility = "hidden";			},		write: function(n){			var div = $("colorpicker-div");			var output = "";			output += '<table border="1" cellpadding="0" cellspacing="0" class="wysiwyg_color-picker-table"><tr>';			for(var i = 0; i < COLORS.length; i++) {				var color = COLORS[i];				output += '<td class="selectColorBorder" ';				output += 'onmouseover="this.className=\'selectColorOn\';" ';				output += 'onmouseout="this.className=\'selectColorOff\';" ';				output += 'onclick="WYSIWYG_ColorInst.select(\'' + n + '\', \'' + color + '\');"> ';				output += '<div style="background-color:' + color + ';" class="wysiwyg_color-picker-div">&nbsp;</div> ';				output += '</td>';				if(((i+1) % Math.round(Math.sqrt(COLORS.length))) == 0) {					output += "</tr><tr>";					}				}			output += '</tr></table>';			div.innerHTML = output;			}		}	};var eLogin = {	preload: function(){		Element.Preload('images/ajax-loading.gif');		},	out: function(m){		$('login_result').innerHTML = m;		},	init: function(){		var user = $('user_input').value;		var pass = $('pass_input').value;		if(user == ''){			Console.alert('Please enter a username to login');			}		else if(pass == ''){			Console.alert('Please enter a password to login');			}		else{			eLogin.out('Logging In <img width="15px" height="15px" src="images/ajax-loading.gif">');			var Response = Ajax.get("login.php?server&user="+user+"&pass="+pass, null, false, null);			Timer.set(function(){eLogin.init_server(Response, 0);}, 1000);			}		},	init_server: function(Response, Counter){		if(Ajax.Output[Response] != '[LOADING]'){			if(Ajax.Output[Response] == 1611 || Ajax.Output[Response] == 1612){				eLogin.init_edline();				}			else if(Ajax.Output[Response] == 1623){				Browser.Goto('members.php');				eLogin.out("Redirecting to the <a href=\"members.php\">Administrator's Page</a>...");				}			else if(Ajax.Output[Response] == 1622){				Browser.Goto('members.php');				eLogin.out("Redirecting to the <a href=\"members.php\">Officer's Page</a>...");				}			else if(Ajax.Output[Response] == 1621){				Browser.Goto('members.php');				eLogin.out("Redirecting to the <a href=\"members.php\">Member's Page</a>...");				}			else{				eLogin.failed('srvr_code', Ajax.Output[Response]);				}			}		else{			if(Counter == 10){				eLogin.failed('srvr_timeout');				}			else{				Counter++;				Timer.set(function(){eLogin.init_server(Response, Counter);}, 500);				}			}		},	init_edline: function(){		var login_popup = window.open("login.php?edline&user="+$('user_input').value+"&pass="+$('pass_input').value, "edLogWin", "location=0, status=0, scrollbars=0, width=1, height=1");		Timer.set(function(){eLogin.edline_login(login_popup);}, 1000);		},	edline_login: function(login_popup){		if (login_popup && login_popup.top) {			login_popup.close();			var check_popup = window.open("http://edline.net/pages/Reading_HS/Activities-Clubs-Programs/RMHS_Drama_Club/website#confirm=true", "edchkWin", "location=0, status=0, scrollbars=0, width=1, height=1");			Timer.set(function(){eLogin.edline_reciever(check_popup, 0);}, 1000);			}		else eLogin.failed('popup');		},	edline_reciever: function(check_popup, counter){		if (check_popup && check_popup.top) {			try{				check_popup.window.title;				eLogin.edline_success(check_popup);			}			catch(e){				if(counter == 3){					check_popup.close();					eLogin.failed('edline');					}				else{					counter++;					Timer.set(function(){eLogin.edline_reciever(check_popup, counter);}, 1000);					}				}				}		else eLogin.failed('popup');		},	edline_success: function(check_popup){		var d = new Date();		var auth = d.getTime();		var loc = check_popup.location;		var loc = check_popup.location;		try{			loc = loc.toString().split("&authcode=")[1].split("&user=");			var auth2 = loc[0];			var user = loc[1];			user = "&name="+user.replace(/&nbsp;/, "+");			}		catch(e){			loc = loc.toString().split("&authcode=");			var auth2 = loc[1];			var user = '';			}		auth2 = auth2*1;		if((auth - auth2) > 10000){			eLogin.failed('edline_auth');			}		else{			Ajax.get("login.php?&auth="+auth2+"&server&update&user="+$('user_input').value+"&pass="+$('pass_input').value+"&name="+user, null, false, null);			Timer.set(function(){ Browser.Goto('members.php');}, 1000);			}		check_popup.close();		},	failed: function(code){		if(code == 'srvr_code'){			Console.error('eLogin.Server: Invalid Server Responce: '+arguments[1]);			}		else if(code == 'srvr_timeout'){			Console.error('eLogin.Server: No Server Responce Recieved (Timeout)');			}		else if(code == 'edline_auth'){			Console.error('eLogin.Edline: Authorization Code Invalid!');			}		else if(code == 'edline'){			Console.error('eLogin.Edline: Invalid Username or Password');			}		else if(code == 'popup'){			Console.alert('The login-check popup did not open correctly. Please disable all popup blockers and try again');			Console.error('eLogin.Edline: Popup Blocked');			}		eLogin.out("Login Failed!"+Popup.Help('login_failed')+"<br />Please Try Again<br />");		}	};var Update = {	Parent: function(which){		var doneone = false;		for(var i = 0; i < $$$('options').length; i++){			Element.hide($$$('options')[i].id);			}		var Parents = parent.Element.byAttribute('dynamic');		for(var i = 0; i < Parents.length; i++){			Ajax.get(Parents[i].getAttribute('dynamic'), Parents[i], false, null);			}		},	Calendar: {		Add: function(){			var response = Ajax.get('update.php?calendar&action=add&date='+$('add_calendar_date').value+'&start='+$('add_calendar_start').value+'&end='+$('add_calendar_end').value+'&event='+$('add_calendar_event').value+'&description='+$('add_calendar_description').value+'&applies='+$('add_calendar_applies').value, null, true, null);			Update.zzz(response, 0);			},		Edit: function(){			Console.error('Update.Calendar.Edit is Undefined');			},		Delete: function(){			Console.error('Update.Calendar.Delete is Undefined');			}		},	Page: function(link){		WYSIWYG.updateById('edit_page_content');		var Response = Ajax.get('update.php?page&link='+String.ajaxencode(link)+'&content='+String.ajaxencode($('edit_page_content').value), null, true, null);		Update.zzz(Response, 0);		},	Production: {		Add: function(){			var Response = Ajax.get('update.php?production&add&name='+$('add_production_name').value+'&season='+$('add_production_season').value+'&year='+$('add_production_year').value+'&status='+$('add_production_status').value+'&description='+$('add_production_description').value+'&image='+$('add_production_image').value, null, true, null);			Update.zzz(Response, 0);			},		Edit: function(){			Console.error('Update.Production.Edit is Undefined');			},		Delete: function(id){			if(defined(id)){				var Response = Ajax.get('update.php?production&delete&id='+id, null, true, null);				Update.zzz(Response, 0);				}			else if(confirm('Are you sure you want to delete this production, including all photos?')){				var Response = Ajax.get('update.php?production&delete&id='+$('delete_production_id').value, null, true, null);				Update.zzz(Response, 0);				}			}		},	News: {		Add: function(){			WYSIWYG.updateById('add_news_body'); 			var Response = Ajax.get('update.php?news&add&title='+$('add_news_title').value+'&body='+$('add_news_body').value, null, true, null);			Update.zzz(Response, 0);			},		Edit: function(){			WYSIWYG.updateById('add_news_body'); 			var Response = Ajax.get('update.php?news&edit&id='+id+'&firstname='+$('edit_user_firstname').value+'&lastname='+$('edit_user_lastname').value+'&password='+$('edit_user_password').value+'&type='+$('edit_user_type').value, null, true, null);			Update.zzz(Response, 0);			},		Delete: function(id){			if(defined(id)){				var Response = Ajax.get('update.php?news&delete&id='+id, null, true, null);				Update.zzz(Response, 0);				}			else if(confirm('Are you sure you want to delete this story?')){				var Response = Ajax.get('update.php?news&delete&id='+$('delete_production_id').value, null, true, null);				Update.zzz(Response, 0);				}			}		},	User: {		Add: function(){			var Response = Ajax.get('update.php?user&add&username='+$('add_user_username').value+'&firstname='+$('add_user_firstname').value+'&lastname='+$('add_user_lastname').value+'&password='+$('add_user_password').value+'&email='+$('add_user_email').value+'&type='+$('add_user_type').value, null, true, null);			Update.zzz(Response, 0);			},		Load: function(){			Browser.Goto('user.php?action=edit&id='+$('load_user_id').value);			},		Edit: function(id){			var Response = Ajax.get('update.php?user&edit&id='+id+'&firstname='+$('edit_user_firstname').value+'&lastname='+$('edit_user_lastname').value+'&password='+$('edit_user_password').value+'&type='+$('edit_user_type').value, null, true, null);			Update.zzz(Response, 0);			},		Cancel: function(){			Browser.Goto('user.php?action=edit');			},		Delete: function(id){			if(!defined(id)){				id = $('delete_user_id').value;				}			var Response = Ajax.get('update.php?user&delete&id='+id, null, true, null);			Update.zzz(Response, 0);			}		},	SendMail: function(){		var Response = Ajax.get('update.php?email&to='+String.ajaxencode($('send_mail_to').value)+'&subject='+String.ajaxencode($('send_mail_subject').value)+'&message='+String.ajaxencode($('send_mail_message').value), null, true, null);		Update.zzz(Response, 0);		},	zzz: function(Response, Counter){		if(!defined(Counter)){ Counter = 0; }		if(Ajax.Output[Response] != '[LOADING]'){			Update.Parent('*');			Popup.Note(Ajax.Output[Response]);			Timer.set('Popup.Note_close();', 1000);			if(Ajax.Output[Response] == "Success!"){				Timer.set('Popup.Frame_close();', 1000);				}			}		else{			if(Counter == 10){				Popup.Note('Error. Please Try Again.<br />[Client>Update>zzz]');				Timer('Popup.Note_close();', 1000);				}			else{				Counter++;				Timer.set(function(){Update.zzz(Response, Counter);}, 500);				}			}		}	};var aTab = {	pad: 10,	currentTab: 0,	activeTab: 0,	destX: 0,	destW: 0,	t: 0,	b: 0,	c: 0,	d: 50,	interval: null,	slideObj: null,	aHeight: 0,	load: function() {		if(!document.getElementById("animatedMenu")){			return;			}		var ul = $("animatedMenu");		var tabs = ul.getElementsByTagName("li");		var links = ul.getElementsByTagName("a");		for(var i = 0, tab; tab = tabs[i]; i++){			tabs[i].onmouseover = links[i].onfocus = function(e){				var pos = 0;				var element = this.nodeName == "LI" ? this : this.parentNode;				while(element.previousSibling) {					element = element.previousSibling;					if(element.tagName && element.tagName == "LI"){						pos++;						}					}				aTab.slide(pos);				}			}		ul.onmouseout = function(e){			aTab.slide(aTab.currentTab);			};		for(var i = 0; i < links.length; i++){			if(document.location.href.indexOf(links[i].href)>=0){				aTab.activeTab = aTab.currentTab = i;				}			links[i].style.borderBottom  = "0px";			links[i].style.paddingBottom = "6px";		}		aTab.slideObj = ul.parentNode.appendChild(document.createElement("div"));		aTab.slideObj.appendChild(document.createTextNode(String.fromCharCode(160)));		aTab.slideObj.id = "animated-tab";		var temp = (ul.offsetTop + tabs[aTab.activeTab].offsetTop + links[aTab.activeTab].offsetTop);		temp = 20;		aTab.slideObj.style.top = temp + "px";		aTab.slideObj.style.left = (ul.offsetLeft + + tabs[aTab.activeTab].offsetLeft + links[aTab.activeTab].offsetLeft) - pad + "px";		aTab.slideObj.style.width = links[aTab.activeTab].offsetWidth + 5 + "px";		aTab.aHeight = ul.offsetTop + tabs[aTab.activeTab].offsetTop + links[aTab.activeTab].offsetTop;		aTab.slide(aTab.activeTab, true);		var intervalMethod = function() { aTab.slideIt(); }		aTab.interval = setInterval(intervalMethod,10);		},	slide: function(pos, force) {		if(!force && pos == aTab.activeTab) return;		aTab.activeTab = pos;		aTab.animate();		},	animate: function() {		var ul = document.getElementById("animatedMenu");		var tabs = ul.getElementsByTagName("li");		var links = ul.getElementsByTagName("a");		aTab.destX = parseInt(tabs[aTab.activeTab].offsetLeft + tabs[aTab.activeTab].getElementsByTagName("a")[0].offsetLeft + ul.offsetLeft);		aTab.destW = parseInt(tabs[aTab.activeTab].getElementsByTagName("a")[0].offsetWidth);		aTab.t = 0;		aTab.b = aTab.slideObj.offsetLeft;		aTab.c = aTab.destX - aTab.b;		aTab.bW = aTab.slideObj.offsetWidth;		aTab.cW = aTab.destW - aTab.bW;		aTab.slideObj.style.top = (ul.offsetTop + tabs[aTab.activeTab].offsetTop + links[aTab.activeTab].offsetTop) - pad + "px";		},	slideIt: function() {		var ul = $("animatedMenu");		var tabs = ul.getElementsByTagName("li");		var links = ul.getElementsByTagName("a");		if(aTab.aHeight != ul.offsetTop + tabs[aTab.activeTab].offsetTop + links[aTab.activeTab].offsetTop){		  aTab.animate();		  aTab.aHeight = ul.offsetTop + tabs[aTab.activeTab].offsetTop + links[aTab.activeTab].offsetTop;		};		if(aTab.t++ < aTab.d) {			var x = aTab.animateIt(aTab.t,aTab.b,aTab.c,aTab.d);			var w = aTab.animateIt(aTab.t,aTab.bW,aTab.cW,aTab.d);			aTab.slideObj.style.left = parseInt(x - aTab.pad) + "px";			aTab.slideObj.style.width = parseInt(w + aTab.pad) + "px";			}		else {			aTab.slideObj.style.left = aTab.destX - aTab.pad + "px";			aTab.slideObj.style.width = aTab.destW + aTab.pad +"px";			}		},	animateIt: function(t,b,c,d) {		if ((t/=d/2) < 1) return c/2*t*t + b;		return -c/2 * ((--t)*(t-2) - 1) + b;		}	};var SubMenu = {	Colors: ["#00CC66", "#CC6600", "#CC0066", "#6600CC", "#0066CC", "#66CC00"],	Config: [],	init: function(){		var menus = $$$('SubMenuConfig');		for(var i = 0; i < menus.length; i++) SubMenu.create(i, menus[i]);		},	create: function(I, N){		SubMenu.Config[I] = new function(){			this.tabs = $$('span', N);			this.titles = $$('a', N);			this.bodies = $$('p', N);			this.current = 0;			}		var out = '<table cellspacing="0" id="SubMenuOutput" width="100%" style="padding-bottom: 0px; margin-bottom: 0px;"><tr id="IFF_TabRow" height="30px">', inn = '', tabWidth = (100 / SubMenu.Config[I].tabs.length) + '%';		for(var i = 0; i < SubMenu.Config[I].tabs.length; i++){			out += '<td style="width: '+tabWidth+'; padding-right: 2px; padding-left: 2px; padding-top: 0px; padding-bottom: 0px;" align="center" id="SubMenuTab'+i+'"><div id="SubMenuTab'+i+'_Div" class="top_rounded" style="width: 100%; height: 30px; background-color: '+SubMenu.Colors[i]+'; cursor:pointer; color: #FFFFFF; padding: 0px; margin-top: 10px;" onclick="SubMenu.Change('+I+','+i+')"><span style="color: #FFFFFF; font-size: 120%;">'+SubMenu.Config[I].titles[i].innerHTML+'</span></div></td>';			inn += '<div id="SubMenuTab'+i+'_Content" width="100%" style="display: none; height: 450px; overflow-y: auto;">'+SubMenu.Config[I].bodies[i].innerHTML+'</div>';			}		N.insertAdjacentHTML("afterEnd", out+'</tr></table>'+inn);		SubMenu.Change(I, 0);		return true;		},	Change: function(I, Tab){		for(var i = 0; i < SubMenu.Config[I].tabs.length; i++){			Element.undisplay('SubMenuTab'+i+'_Content');			if (Tab == i){				$('SubMenuTab'+i+'_Content').style.border = '5px '+SubMenu.Colors[Tab]+' solid';				Element.display('SubMenuTab'+i+'_Content');				}			}		return true;		}	};var Slideshow = {	Config: [],	init: function(){		var slideshows = $$$('slideshow');		for(var i = 0; i < slideshows.length; i++) Slideshow.create(i, slideshows[i]);		},	create: function(N, S){		Console.log('Loading Slideshow #'+N+'('+S.id+')');		var code = '<div align="center" id="Slideshow'+N+'" style="height: 110px; width: 100%; vertical-align: middle;">';		for(var i = 0; i < 5; i++) code += '<a id="Slideshow'+N+'_Link'+i+'"><img id="Slideshow'+N+'_Image'+i+'" style="padding:5px;"></a>';		S.insertAdjacentHTML("afterEnd", code+'</div>');		Slideshow.Config[N] = new function(){			this.output = [];			this.output[0] = $('Slideshow'+N+'_Image0');			this.output[1] = $('Slideshow'+N+'_Image1');			this.output[2] = $('Slideshow'+N+'_Image2');			this.output[3] = $('Slideshow'+N+'_Image3');			this.output[4] = $('Slideshow'+N+'_Image4');			this.link = [];			this.link[0] = $('Slideshow'+N+'_Link0');			this.link[1] = $('Slideshow'+N+'_Link1');			this.link[2] = $('Slideshow'+N+'_Link2');			this.link[3] = $('Slideshow'+N+'_Link3');			this.link[4] = $('Slideshow'+N+'_Link4');			this.position = [];			this.position[0] = 3;			this.position[1] = 4;			this.position[2] = 0;			this.position[3] = 1;			this.position[4] = 2;			this.images = $$('span', S);			this.links = $$('a', S);			this.next = 5;			this.current = 4;			this.lastout = Math.floor(Math.random()*5);			}		Slideshow.begin(N);		},	begin: function(N){		for(var i = 0; i < Slideshow.Config[N].output.length; i++){			Slideshow.Config[N].output[i].src = Slideshow.Config[N].images[i].innerHTML;			if(defined(Slideshow.Config[N].links[Slideshow.Config[N].next])){				LightBox.prep(Slideshow.Config[N].links[i], Slideshow.Config[N].link[i]);				Slideshow.Config[N].link[i].style.cursor = 'pointer';				}			}		Timer.set(function(){Slideshow.advance(N);}, 1000*N);		},	advance: function(N){		var P = Slideshow.Config[N].position[Slideshow.Config[N].lastout];		Slideshow.Config[N].next = (Slideshow.Config[N].current < (Slideshow.Config[N].images.length - 1)) ? Slideshow.Config[N].current + 1 : 0;		Element.Preload(Slideshow.Config[N].images[Slideshow.Config[N].next].innerHTML);		LightBox.prep(Slideshow.Config[N].links[Slideshow.Config[N].next], Slideshow.Config[N].link[P]);		Slideshow.Config[N].link[P].style.cursor = 'pointer';		Effect.Disappear(Slideshow.Config[N].output[P], { onload: "Slideshow.Config["+N+"].output["+P+"].src = Slideshow.Config["+N+"].images[Slideshow.Config["+N+"].next].innerHTML; Effect.Appear(Slideshow.Config["+N+"].output["+P+"]); " });		Slideshow.Config[N].current = Slideshow.Config[N].next;		Slideshow.Config[N].lastout = P;		Timer.set(function(){Slideshow.advance(N);}, 4000);		}	};var Corners = {	X: [],	All: function(){		var els = $$$('rounded');		for(var i = 0; i < els.length; i++){			Corners.Apply(els[i]);			}		els = $$$('top_rounded');		for(var i = 0; i < els.length; i++){			Corners.Apply(els[i], {bl: null, br: null});			}		},	Apply: function(el, options){		if(!$(el)) return;		if(!defined(options)){ options = []; }		var N = Corners.X.length, d;		var vHeight = Element.Style(el, "height");		var vWidth = Element.Style(el, "width");		var vPadding = Element.Style(el, "paddingTop", "padding-top");		var vImage = Element.Style(el, "backgroundImage", "background-image");		var vbWidth = Element.Style(el, "borderTopWidth", "border-top-width");		var tContainer, bContainer;		d = {			tl: 10, tr: 10, bl: 10, br: 10,			Height: parseInt(((vHeight != "" && vHeight != "auto" && vHeight.indexOf("%") == -1) ? parseInt(vHeight.substring(0,vHeight.indexOf("px"))) : el.scrollHeight)),			Width: parseInt(((vWidth != "" && vWidth != "auto" && vWidth.indexOf("%") == -1) ? parseInt(vWidth.substring(0,vWidth.indexOf("px"))) : el.scrollWidth)),			Color: Corners.Color(Element.Style(el, "backgroundColor", "background-color")),			Padding: parseInt(((vPadding != "" && vPadding.indexOf("px") !== -1) ? String.Slice(vPadding) : 0)),			bWidth: parseInt(((vbWidth != "" && vbWidth.indexOf("px") !== -1) ? String.Slice(vbWidth) : 0)),			bColor: Corners.Color(Element.Style(el, "borderTopColor", "border-top-color")),			bgImage: ((vImage != "none") ? vImage : "")			}		Corners.X[N] = Element.merge(d, options);		Corners.X[N].border = Corners.X[N].bWidth + "px solid " + Corners.X[N].bColor;		if(Browser.IE && vWidth == "auto" && vHeight == "auto") el.style.width = "100%";		if(Corners.X[N].tl || Corners.X[N].tr){			var tmr = Math.max(Corners.X[N].tl ? Corners.X[N].tl : 0, Corners.X[N].tr ? Corners.X[N].tr : 0);			tContainer = el.appendChild(Corners.Container(N,tmr,true));			Corner = Corners.Corner(N, "tr", tmr, (Corners.X[N]["tr"] != null));			if(Corner.style.position == "absolute"){				Corner.style.top = "0px"; Corner.style.right = "0px";				}			tContainer.appendChild(Corner);			Corner = Corners.Corner(N, "tl", tmr, (Corners.X[N]["tl"] != null));			if(Corner.style.position == "absolute"){				Corner.style.top = "0px"; Corner.style.left = "0px";				}			tContainer.appendChild(Corner);			el.style.borderTopWidth = "0px";			el.style.backgroundPosition = "0px -" + (tmr - Corners.X[N].bWidth) + "px";			tContainer.appendChild(Corners.Bar(N,'t',tmr));					}		if(Corners.X[N].bl || Corners.X[N].br){			var bmr = Math.max(Corners.X[N].bl ? Corners.X[N].bl : 0, Corners.X[N].br ? Corners.X[N].br : 0);			bContainer = el.appendChild(Corners.Container(N,bmr,false));			Corner = Corners.Corner(N, "br", tmr, (Corners.X[N]["br"] != null));			if(Corner.style.position == "absolute"){				Corner.style.bottom = "0px"; Corner.style.right = "0px";				}			bContainer.appendChild(Corner);			Corner = Corners.Corner(N, "bl", tmr, (Corners.X[N]["bl"] != null));			if(Corner.style.position == "absolute"){				Corner.style.bottom = "0px"; Corner.style.left = "0px";				}			bContainer.appendChild(Corner);			el.style.borderBottomWidth = "0px";			bContainer.appendChild(Corners.Bar(N,'b',bmr));					}		var content = document.createElement("DIV");		content.style.position = "relative";		content.innerHTML = el.innerHTML		content.className = "autoPadDiv";		var topPadding = Math.abs(tmr - Corners.X[N].Padding);		var botPadding = Math.abs(bmr - Corners.X[N].Padding);		if(tmr < Corners.X[N].Padding) content.style.paddingTop = topPadding + "px";		if(bmr < Corners.X[N].Padding) content.style.paddingBottom = bmr + "px";		content.style.paddingLeft = Corners.X[N].Padding + "px";		content.style.paddingRight = Corners.X[N].Padding + "px";		if(Element.Style(el, "position") != "absolute") el.style.position = "relative";		el.innerHTML = "";		el.style.padding = "0px";		el.appendChild(content);		},	Container: function(N, R, T){		var C = document.createElement("DIV");		C.id = "container-"+T+"-"+N;		C.style.width = "100%";		C.style.fontSize = "1px";		C.style.overflow = "hidden";		C.style.position = "absolute";		C.style.paddingLeft = Corners.X[N].bWidth + "px";		C.style.paddingRight = Corners.X[N].bWidth + "px";		C.style.height = R + "px";		if(T) C.style.top = 0 - (R-2) + "px";		else C.style.bottom = 0 - (R-2) + "px";		C.style.left = 0 - Corners.X[N].bWidth + "px";		return C;				},	Corner: function(N,cc,R,type){		if(type == false){			var C = document.createElement("DIV");			C.style.position = "relative";			C.style.fontSize = "1px";			C.style.overflow = "hidden";			C.style.backgroundColor = Corners.X[N].Color;			if(Corners.X[N].bgImage != ""){				C.style.backgroundImage = Corners.X[N].bgImage;				}			C.style.height = R - Corners.X[N].bWidth + "px";			switch(cc){				case "tl":				C.style.marginRight = Corners.X[N].tr - (Corners.X[N].bWidth*2) + "px";				C.style.borderLeft = Corners.X[N].border;				C.style.borderTop = Corners.X[N].border;				C.style.left = -Corners.X[N].bWidth + "px";				break;					case "tr":				C.style.marginLeft = Corners.X[N].tl - (Corners.X[N].bWidth*2) + "px";				C.style.borderRight = Corners.X[N].border;				C.style.borderTop = Corners.X[N].border;				C.style.backgroundPosition = "-" + (R + Corners.X[N].bWidth) + "px 0px";				C.style.left = Corners.X[N].bWidth + "px";				break;				case "bl":				C.style.marginRight = Corners.X[N].br - (Corners.X[N].bWidth*2) + "px";				C.style.borderLeft = Corners.X[N].border;				C.style.borderBottom = Corners.X[N].border;				C.style.left = -Corners.X[N].bWidth + "px";				C.style.backgroundPosition = "-" + (Corners.X[N].bWidth) + "px -" + (Corners.X[N].Height + (R + Corners.X[N].bWidth)) + "px";				break;				case "br":				C.style.marginLeft = Corners.X[N].bl - (Corners.X[N].bWidth*2) + "px";				C.style.borderRight = Corners.X[N].border;				C.style.borderBottom = Corners.X[N].border;				C.style.left = Corners.X[N].bWidth + "px"				C.style.backgroundPosition = "-" + (R + Corners.X[N].bWidth) + "px -" + (Corners.X[N].Height + (R + Corners.X[N].bWidth)) + "px";				break;				}			return C;			}		var C = document.createElement("DIV");		C.style.height = Corners.X[N][cc] + "px";		C.style.width = Corners.X[N][cc] + "px";		C.style.position = "absolute";		C.style.fontSize = "1px";		C.style.overflow = "hidden";		var bR = Corners.X[N][cc] - Corners.X[N].bWidth;		for(var x = 0, j = Corners.X[N][cc]; x < j; x++){			var y1 = (x+1) ? -1 : (Math.floor(Math.sqrt(Math.pow(bR, 2) - Math.pow((x+1), 2))) - 1);			if(bR != j){				var y2 = (x >= bR) ? -1 : Math.ceil(Math.sqrt(Math.pow(bR,2) - Math.pow(x, 2)));				var y3 = (x+1 >= j) ? -1 : (Math.floor(Math.sqrt(Math.pow(j ,2) - Math.pow((x+1), 2))) - 1);				}			var y4 = (x >= j) ? -1 : Math.ceil(Math.sqrt(Math.pow(j ,2) - Math.pow(x, 2)));			if(y1 > -1){				Corners.Pixel(N, x, 0, Corners.X[N].Color, 100, (y1+1), C, -1, Corners.X[N][cc]);				}			if(bR != j){				for(var y = (y1 + 1); y < y2; y++){					if(Corners.X[N].bgImage != ""){						Corners.Pixel(N, x, y, Corners.X[N].bColor, 100, 1, C, (((Corners.Fraction(x, y, bR) * 100) < 30) ? 0 : -1), Corners.X[N][cc]);						}					else{						Corners.Pixel(N, x, y, Corners.Blend(Corners.X[N].Color, Corners.X[N].bColor, Corners.Fraction(x, y, bR)), 100, 1, C, 0, Corners.X[N][cc], cc);						}					}				if(y3 >= y2){					if (y2 == -1) y2 = 0;					Corners.Pixel(N, x, y2, Corners.X[N].bColor, 100, (y3 - y2 + 1), C, 0, 0);					}				else if(y3 >= y1){					Corners.Pixel(N, x, (y1 + 1), Corners.X[N].bColor, 100, (y3 - y1), C, 0, 0);					}				var outsideColour = Corners.X[N].bColor;				}			else {				var outsideColour = Corners.X[N].Color;				var y3 = y1;				}			for(var y = (y3 + 1); y < y4; y++){				Corners.Pixel(N, x, y, outsideColour, (Corners.Fraction(x, y , j) * 100), 1, C, ((Corners.X[N].bWidth > 0) ? 0 : -1), Corners.X[N][cc]);				}			}		if(cc != "br"){			for(var t = 0; t < C.childNodes.length; t++){				var B = C.childNodes[t], BT=parseInt(B.style.top.substring(0,B.style.top.indexOf("px"))), BL=parseInt(B.style.left.substring(0,B.style.left.indexOf("px"))), BH=parseInt(B.style.height.substring(0,B.style.height.indexOf("px")));				if(cc=="tl" || cc=="bl"){					B.style.left = Corners.X[N][cc] -BL -1 + "px";					}				if(cc=="tr" || cc=="tl"){					B.style.top = Corners.X[N][cc] -BH - BT + "px";					}				var tP = Math.abs(Corners.X[N][cc] -BH -BT - Corners.X[N].bWidth);				var bP = Math.abs((Corners.X[N].Height + Corners.X[N][cc] + BT) - Corners.X[N].bWidth);				var lP = Math.abs((Corners.X[N][cc] -BL -1) - Corners.X[N].bWidth);				var rP = Math.abs((Corners.X[N].Width - Corners.X[N][cc] + Corners.X[N].bWidth) + BL);				switch(cc){					case "tr":					B.style.backgroundPosition = "-"+rP+"px -"+tP+"px";					break;					case "tl":					B.style.backgroundPosition = "-"+lP+"px -"+tP+"px";					break;					case "bl":					B.style.backgroundPosition = "-"+lP+"px -"+bP+"px";					break;					}				}			}		return C;		},	Bar: function(N,z,R,R2){		var B = document.createElement("DIV");		B.style.position = "relative";		B.style.fontSize = "1px";		B.style.overflow = "hidden";		B.style.backgroundColor = Corners.X[N].Color;		B.style.bgImage = Corners.X[N].bgImage;		if(Corners.X[N][z+"l"] && Corners.X[N][z+"r"]){			B.style.height = R - Corners.X[N].bWidth + "px";			B.style.marginLeft = Corners.X[N][z+"l"] - Corners.X[N].bWidth + "px";			B.style.marginRight = Corners.X[N][z+"r"] - Corners.X[N].bWidth + "px";			if(z == 't'){				B.style.borderTop = Corners.X[N].border;				if(Corners.X[N].bgImage != "")				B.style.backgroundPosition = "-"+(R-Corners.X[N].bWidth)+"px 0px";				}			else{				B.style.borderBottom = Corners.X[N].border;				if(Corners.X[N].bgImage != "")				B.style.backgroundPosition = "-" + (R - Corners.X[N].bWidth) + "px -" + (Corners.X[N].Height + (R2 - Corners.X[N].bWidth)) + "px";				}			}		return B;		},	Pixel: function(N, x, y, color, TA, height, Corner, image, CR){		var p = document.createElement("DIV");		p.style.height = height + "px";		p.style.width = "1px";		p.style.position = "absolute";		p.style.fontSize = "1px";		p.style.overflow = "hidden";		if(image == -1 && Corners.X[N].bgImage != ""){			p.style.bgImage = Corners.X[N].bgImage;			p.style.backgroundPosition = "-" + (Corners.X[N].Width - (CR - x) + Corners.X[N].bWidth) + "px -" + ((Corners.X[N].Height + (Math.max(Corners.X[N]["tr"], Corners.X[N]["tl"])) + y) -Corners.X[N].bWidth)+"px";			}		else{p.style.backgroundColor = color; }		if (TA != 100){Element.setOpacity(p, TA); }		p.style.top = y+"px";		p.style.left = x+"px";		Corner.appendChild(p);		},	Blend: function (C1, C2, CF){		var r1 = parseInt(C1.substr(1,2),16);		var g1 = parseInt(C1.substr(3,2),16);		var b1 = parseInt(C1.substr(5,2),16);		var r2 = parseInt(C2.substr(1,2),16);		var g2 = parseInt(C2.substr(3,2),16);		var b2 = parseInt(C2.substr(5,2),16);		var eR = Math.round((r1*CF)+(r2*(1-CF)));		var eG = Math.round((g1*CF)+(g2*(1-CF)));		var eB = Math.round((b1*CF)+(b2*(1-CF)));		if (eR > 255) eR = 255;		if (eR < 0) eR = 0;		if(eG > 255) eG = 255;		if(eG < 0) eG = 0;		if(eB > 255) eB = 255;		if(eB < 0) eB = 0;		return "#"+Corners.ToHex(eR)+Corners.ToHex(eG)+Corners.ToHex(eB);		},	ToHex: function(s){		return Corners.Hex((s / 16) - ((s % 16) / 16))+''+Corners.Hex(s % 16);		},	Hex: function (x){		if((x >= 0) && (x <= 9)) return x;		var l = ["A", "B", "C", "D", "E", "F"];		return l[x-10];		},	Fraction: function (x, y, r){		var p = 0, x = [], y = [], w, i;		i = Math.sqrt((r*r) - (x*x));		if ((i >= y) && (i < (y+1))){			w += "L";			x.push(0);			y.push(i - y);			}		i = Math.sqrt((r*r) - ((x+1)*(x+1)));		if ((i >= y) && (i < (y+1))){			w += "R";			x.push(1);			y.push(i - y);			}		i = Math.sqrt((r*r) - ((y+1)*(y+1)));		if ((i >= x) && (i < (x+1))){			w += "T";			x.push(i - x);			y.push(1);			}		i = Math.sqrt((r*r) - (x*x));		if ((i >= x) && (i < (x+1))){			w += "B";			x.push(i - x)			y.push(0);			}		switch (w){			case "LR":			p = Math.min(y[0],y[1])+((Math.max(y[0],y[1])-Math.min(y[0],y[1]))/2);			break;			case "LB":			p = (y[0]*x[1])/2;			break;			case "TR":			p = 1-(((1-x[0])*(1-y[1]))/2);			break;			case "TB":			p = Math.min(x[0],x[1])+((Math.max(x[0],x[1])-Math.min(x[0],x[1]))/2);			break;			default:			p = 1;			}		return p;		},	Color: function(c){		if(c != "" && c != "transparent"){			if(c.substr(0, 3) == "rgb"){				c = c.substring(4, c.indexOf(")")).split(", ");				return "#"+Corners.ToHex(parseInt(c[0]))+Corners.ToHex(parseInt(c[1]))+Corners.ToHex(parseInt(c[2]));				}			else if(c.length == 4) return "#"+c.substring(1, 2)+c.substring(1, 2)+c.substring(2, 3)+c.substring(2, 3)+c.substring(3, 4)+c.substring(3, 4);			else return c;			}		return "#FFFFFF";		}	};function UponLoad(){	if(defined(window.dt_loaded)){ return false; } window.dt_loaded = true;	Browser.init();	eLogin.preload();	Popup.preload();	KeyPress.init();	Event.Placeholders();	Update.Parent();	Slideshow.init();	SubMenu.init();	UponChange();	}function UponChange(){	// WARNING: DO NOT PUT Update.Parent() here. It calls this function. Thats an infinate loop. NOT good :);	LightBox.init();	Element.CheckAllPositions();	Corners.All();	WYSIWYG.init();	}function UponResize(){	Element.CheckAllPositions();	}try{ EVENT.Add(window, 'DOMContentLoaded', UponLoad); }catch(e){ }window.onload = UponLoad;window.onresize = UponResize;