var snippets = {
	attachEventMethods : function(tgt, event, method) {
		eval('var te = tgt.'+event);
		if(te != null) { 
			var f = te.toString();
			if(clientEnvironment.isIE) {
				var r1 = "/^[^{]*{/g";
				var r2 = "/}$/g";
				eval('r1 = '+r1);
				eval('r2 = '+r2);
				f = f.replace(r1, '');
				f = f.replace(r2, '');
				fnc = new Function(method+f.toString());
			} else {
				f = f.replace('function anonymous() {', '');
				f = f.replace('}', '');
				fnc = new Function(f.toString()+method);
			}
		} else {
			var f = '';
			fnc = new Function(f.toString()+method);
		}
		eval('tgt.'+event+'= fnc');
	},
	attachGetQuery : function(href, vars) {
		var qstr = '';
		for(var i in vars) {
			qstr += '&'+escape(i)+'='+escape(vars[i]);
		}
		qstr = href.indexOf('?') != -1 ? href+qstr : href+'?'+qstr.substring(1);
		return qstr;
	},
	checkSubWindow : function(win) {
		if (!!win) {
			if (isIE != -1 && isWindows ) {
				return win.closed;
			} else {
				return typeof win.document != 'object';
			}
		} else {
			return true;
		}
	},
	getCSSProp : function(elem, prop) {
		if(elem.style && elem.style[prop]) {
			return elem.style[prop];
		} else if(elem.currentStyle) {
			return elem.currentStyle[prop];
		} else if(document.defaultView && document.defaultView.getComputedStyle) {
			prop = prop.replace(/([A-Z])/g, function(match) { return '-'+match.toLowerCase() });
			return document.defaultView.getComputedStyle(elem, '').getPropertyValue(prop);
		} else {
			return null;
		}
	},
	getElement : function(name, nest) {
		nest = nest ? 'document.'+nest+'.' : '';
		var el = clientEnvironment.isW3C ? document.getElementById(name) : clientEnvironment.isIE ? document.all[name] : false;
		el.css = el.style;
		el.getTop = function() { return parseInt(el.css.top) || 0 };
		el.setTop = function(y) { el.css.top =  y+'px' };
		el.getHeight = function() { return el.offsetHeight };
		el.getClipHeight = function() { return el.offsetHeight };
		return el;
	},
	getScrollLeft : function(paneName) {
		if(paneName) {
			return document.getElementById(paneName).scrollLeft ? document.getElementById(paneName).scrollLeft : 0 ;
		} else {
			return document.getElementsByTagName('body')[0].scrollLeft ? document.getElementsByTagName('body')[0].scrollLeft : 0 ;
		}
	},
	getScrollTop : function(paneName) {
		if(paneName) {
			return document.getElementById(paneName).scrollTop ? document.getElementById(paneName).scrollTop : 0 ;
		} else {
			return document.getElementsByTagName('body')[0].scrollTop ? document.getElementsByTagName('body')[0].scrollTop : 0 ;
		}
	},
	getElementXpos : function(el) {
		var x = 0;
		while(el.offsetParent) {
			x += el.offsetLeft;
			el = el.offsetParent;
		}
		return x;
	},
	getElementYpos : function(el) {
		var y = 0;
		while(el.offsetParent) {
			y += el.offsetTop;
			el = el.offsetParent;
		}
		return y;
	},
	getWindowWidth : function() {
		if(clientEnvironment.isIE) return (document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.clientWidth;
		else return window.innerWidth;
	},
	getWindowHeight : function() {
		if(clientEnvironment.isIE) return (document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight;
		else return window.innerHeight;
	},
	removeAlpha : function(str) {
		var re = "/[a-zA-Z]/g";
		if(clientEnvironment.isIE) {
			eval('re = '+re);
		}
		if(str.search(re) != -1) {
			result = str.replace(re, '');
		}
		return parseInt(result);
	}
}

var clientEnvironment = {
	isW3C : document.getElementById,
	isIE : document.all,
	isNS4 : document.layers,
	isNS6 : (document.getElementById && window.navigator.appName.indexOf('Netscape') != -1),
	isOpera : (navigator.userAgent.indexOf('Opera') != -1),
	isWindows : (window.navigator.userAgent.indexOf('Windows 95') != -1) || (window.navigator.userAgent.indexOf('Windows 98') != -1) || (window.navigator.userAgent.indexOf('Windows NT') != -1),
	isUNIX : (window.navigator.appVersion.indexOf('X11') != -1) || (window.navigator.appVersion.indexOf('Linux') != -1) || (window.navigator.appVersion.indexOf('SunOS') != -1) || (window.navigator.appVersion.indexOf('IRIX') != -1) || (window.navigator.appVersion.indexOf('HP-UX') != -1),
	isMac : (window.navigator.appVersion.indexOf('Mac') != -1),
	isMacIE : (window.navigator.appVersion.indexOf('Mac') != -1 && document.all),
	isLowSpec : (window.navigator.userAgent.indexOf('Windows 95') != -1) || (window.navigator.userAgent.indexOf('Windows 98') != -1) || (window.navigator.appVersion.indexOf('Mac') != -1),
	Flash : {
		hasVersion : function(requiredVersion) {
			var requiredVersion = parseInt(requiredVersion);
			if(navigator.plugins != null && navigator.plugins.length > 0) {
				var version = 0;
				var plugin = navigator.plugins['Shockwave Flash'];
				if(typeof plugin == 'object') {
					var description = plugin.description;
					version = parseInt(description.charAt(description.indexOf('.')-1));
				}
				return (version >= requiredVersion) ? true : false;
			} else if(navigator.appVersion.indexOf('Mac') == -1 && window.execScript) {
				clientEnvironment.Flash.hasVersion_result = false;
				for(var i = requiredVersion; i <= requiredVersion+5 && clientEnvironment.Flash.hasVersion_result != true; i++){
					execScript('on error resume next: clientEnvironment.Flash.hasVersion_result=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))', 'vbscript');
				}
				return clientEnvironment.Flash.hasVersion_result;
			}
			return null;
		},
		redirect : function(requiredVersion, noFlashPage) {
			if(document.referrer.indexOf(noFlashPage) != -1) return;
			if(!this.hasVersion(requiredVersion)) window.location.href = noFlashPage;
		},
		write : function(id, file, version, width, height, align, hspace, vspace, showMenu, wmode, varsObj) {
			if(!this.hasVersion(version)) {
				document.write('<a href="http://www.macromedia.com/jp/shockwave/download/?P1_Prod_Version=ShockwaveFlash&Lang=Japanese">If you are to see this Flash content the latest Flash Player must be requied.</a>');
			} else {
				var fvars = vars = '';
				if(varsObj) {
					for(var i in varsObj) fvars += i+'='+escape(varsObj[i])+'&';
					vars = '?'+fvars;
				}
				var swf = '<object';
				swf += ' id="'+id+'"';
				swf += ' width="'+width+'"';
				swf += ' height="'+height+'"';
				if(align) swf += ' align="'+align+'"';
				if(hspace) swf += ' hspace="'+hspace+'"';
				if(vspace) swf += ' vspace="'+vspace+'"';
				swf += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"';
				swf += ' codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+',0,0,0">';
				swf += '<param name="movie" value="'+file+vars+'">';
				if(varsObj) swf += '<param name="FlashVars" value="'+fvars+'">';
				if(wmode) swf += '<param name="wmode" value="transparent">';
				if(!showMenu) swf += '<param name="menu" value="false">';
				swf += '<embed src="'+file+vars+'"';
				swf += ' id="'+id+'"';
				swf += ' name="'+id+'"';
				swf += ' width="'+width+'"';
				swf += ' height="'+height+'"';
				if(varsObj) swf += ' FlashVars="'+fvars+'"';
				if(wmode) swf += '<param name="wmode" value="transparent">';
				if(!showMenu) swf += ' menu="false"';
				swf += ' swLiveConnect=true';
				swf += ' type="application/x-shockwave-flash"';
				swf += ' pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
				swf += '<\/embed>';
				swf += '<\/object>';
				document.write(swf);
			}
		}
	}
};

var pageQuery = {
	vars : {},
	getValues : function() {
		if(location.search.length > 0) {
			var pairs = location.search.substring(1).split('&');
			for(var i = 0; i < pairs.length; i++) {
				pairs[i] = pairs[i].split('=');
				this.vars[pairs[i][0]] = unescape(pairs[i][1]);
			}
		}
	}
};
pageQuery.getValues();

var pageCookie = {
	vars : {},
	set : function(name, value, days) {
		var days = (days) ? days : 365 ;
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = '; expires='+date.toGMTString();
		document.cookie = name+'='+escape(value)+'; '+expires+'; path=/';
	},
	get : function(name) {
		name += '=';
		var pairs = document.cookie.split('; ');
		for(var i=0; i<pairs.length; i++){
			var ck = pairs[i];
			if(ck.indexOf(name) == 0){
				return unescape(ck.substring(name.length, ck.length));
			}
		}
		return null;
	},
	getAll : function() {
		var pairs = document.cookie.split('; ');
		for(var i=0; i<pairs.length; i++) {
			pairs[i] = pairs[i].split('=');
			this.vars[pairs[i][0]] = unescape(pairs[i][1]);
		}
	},
	erase : function(name) {
		this.set(name, '', -1);
	},
	enabled : function() {
		this.set('cookieCheck', 'ok');
		return this.get('cookieCheck') != null;
	},
	input : function(tgt) {
		for (i=0; i<tgt.elements.length; i++) {
			if (this.vars[tgt.elements[i].name]) {
				tgt.elements[i].value = this.vars[tgt.elements[i].name];
			}
		}
	}
};
pageCookie.getAll();

var pageReference = {
	scrollLoop : false, scrollInterval : null,
	scrollPaneName : '', scrollTargetName : '', pageTopName : '',
	scrollValueContainerLeft : '', scrollValueContainerTop : '', scrollValueContainerFocus : '',
	scrollTo : function(id, spName, tgtName) {
		if(!clientEnvironment.isW3C) { location.href = '#'+id; return; }
		if(this.scrollLoop) { clearInterval(this.scrollInterval); this.scrollLoop = false; this.scrollInterval = null; }
		this.scrollPane = spName ? document.getElementById(spName) : this.scrollPaneName ? document.getElementById(this.scrollPaneName) : document.getElementsByTagName('body')[0];
		var scrollPaneHeight = this.scrollPane.offsetHeight;
		var doc = tgtName ? document.getElementById(tgtName) : document.getElementById(this.scrollTargetName);
		//var documentHeight = snippets.getElementYpos(document.getElementById(spName ? spName : this.scrollPaneName))+doc.offsetHeight;
		var documentHeight = doc.offsetHeight;
		var ypos = snippets.getElementYpos(document.getElementById(id))-snippets.getElementYpos(this.scrollPane);
		if(ypos > documentHeight-scrollPaneHeight) ypos = documentHeight-scrollPaneHeight;
		this.scroll(0, ypos, spName);
	},
	scroll : function(x, y, spName) {
		this.scrollPane = spName ? document.getElementById(spName) : this.scrollPaneName ? document.getElementById(this.scrollPaneName) : document.getElementsByTagName('body')[0];
		if(this.scrollLoop) {
			var left = snippets.getScrollLeft(spName ? spName : this.scrollPaneName);
			var top = snippets.getScrollTop(spName ? spName : this.scrollPaneName);
			if(Math.abs(left-x) <= 1 && Math.abs(top-y) <= 1) {
				this.scrollPane.scrollLeft = x;
				this.scrollPane.scrollTop = y;
				clearInterval(this.scrollInterval); this.scrollLoop = false; this.scrollInterval = null;
			} else {
				this.scrollPane.scrollLeft = left+(x-left)/2;
				this.scrollPane.scrollTop = top+(y-top)/2;
			}
		} else {
			this.scrollInterval = setInterval('pageReference.scroll('+x+','+y+', \''+spName+'\')', 10);
			this.scrollLoop = true;
		}
	},
	top : function() {
		if(snippets.getScrollTop(this.scrollPaneName) == 0) {
			location.href = '#'+this.pageTopName;
			return;
		}
		this.scroll(snippets.getScrollLeft(this.scrollPaneName), 0, this.scrollPaneName);
	},
	remindScroll : function(form) {
		if(clientEnvironment.isW3C) {
			this.scrollPane     = this.scrollPaneName ? document.getElementById(this.scrollPaneName) : document.getElementsByTagName('body')[0];
			this.targetForm     = form ? document.getElementById(form) : undefined;
			this.leftContainer  = this.scrollValueContainerLeft  ? document.getElementById(this.scrollValueContainerLeft)  : undefined;
			this.topContainer   = this.scrollValueContainerTop   ? document.getElementById(this.scrollValueContainerTop)   : undefined;
			this.focusContainer = this.scrollValueContainerFocus ? document.getElementById(this.scrollValueContainerFocus) : undefined;
			this.leftValue      = this.leftContainer  ? this.leftContainer.value : pageQuery.vars['scrollLeft'] ? pageQuery.vars['scrollLeft'] : 0;
			this.topValue       = this.topContainer   ? this.topContainer.value : pageQuery.vars['scrollTop']  ? pageQuery.vars['scrollTop']  : 0;
			this.focusedElement = this.focusContainer ? this.focusContainer.value : pageQuery.vars['focus']      ? pageQuery.vars['focus'] : undefined;
			this.focusedElement = this.focusedElement == 'undefined' ? undefined : this.focusedElement;
			snippets.attachEventMethods(this.scrollPane, 'onscroll', 'pageReference.setLeftValue(pageReference.scrollPane.scrollLeft); pageReference.setTopValue(pageReference.scrollPane.scrollTop);');
			preLoadFuncs.entry.push('pageReference.preLoadFunc');
		}
	},
	prepScrollQuery : function(tgt, attr, evt) {
		snippets.attachEventMethods(tgt, evt, 'location.href = snippets.attachGetQuery(this.'+attr+', { scrollLeft: pageReference.leftValue, scrollTop: pageReference.topValue, focus: pageReference.focusedElement }); return false;');
	},
	setLeftValue : function(val) {
		this.leftValue = val;
		if(this.leftContainer) this.leftContainer.value = val;
	},
	setTopValue : function(val) {
		this.topValue = val;
		if(this.topContainer) this.topContainer.value = val;
	},
	setFocusValue : function(val) {
		this.focusedElement = val;
		if(this.focusContainer) this.focusContainer.value = val;
	},
	setScroll : function() {
		this.scrollPane.scrollLeft = this.leftValue;
		this.scrollPane.scrollTop = this.topValue;
	},
	setOnFocusFunc : function() {
		if(this.targetForm) {
			for(i=0; i<this.targetForm.elements.length; i++) {
				snippets.attachEventMethods(this.targetForm.elements[i], 'onfocus', 'pageReference.setFocusValue(this.id.toString());');
			}
		}
	},
	preLoadFunc : function() {
		this.setScroll();
		this.setOnFocusFunc();
		if(this.focusedElement && clientEnvironment.isIE) {
			document.getElementById(this.focusedElement).focus();
		}
	}
};

var pageScrollPane = function(id, speed, upObj, downObj, contentMaskObj, contentObj) {
	this.id = id;
	this.speed = speed;
	this.upObj = snippets.getElement(upObj);
	this.downObj = snippets.getElement(downObj);
	this.contentMaskObj = snippets.getElement(contentMaskObj);
	this.contentObj = snippets.getElement(contentObj, contentMaskObj);
	this.obj = contentObj+'Object';
	eval(this.obj+'=this');
	this.contentMaskHeight = this.contentMaskObj.getClipHeight();
	this.contentHeight = this.contentObj.getHeight();
	this.contentLength = this.contentHeight-this.contentMaskHeight;
	this.scrollLength = this.trackLength/this.contentLength;
	this.scrollTimer = null;
	if(clientEnvironment.isIE) {
		this.contentObj.css.position = 'absolute';
	}
	if(this.contentHeight <= this.contentMaskHeight){
	} else {
		snippets.attachEventMethods(this.upObj, 'onmousedown', this.id+'.scroll('+this.speed+'); return false;');
		snippets.attachEventMethods(this.upObj, 'onmouseup', this.id+'.stopScroll();');
		snippets.attachEventMethods(this.upObj, 'onmouseout', this.id+'.stopScroll();');
		snippets.attachEventMethods(this.downObj, 'onmousedown', this.id+'.scroll('+-this.speed+'); return false;');
		snippets.attachEventMethods(this.downObj, 'onmouseup', this.id+'.stopScroll();');
		snippets.attachEventMethods(this.downObj, 'onmouseout', this.id+'.stopScroll();');
	}
}
pageScrollPane.prototype.scroll = function(speed){
	var contentMovement = this.contentObj.getTop()+speed;
	if(contentMovement > 0) {
		contentMovement = 0;
	} else if(contentMovement < -this.contentLength) {
		contentMovement = -this.contentLength;
	}
	this.contentObj.setTop(contentMovement);
	this.scrollTimer = window.setTimeout(this.obj+'.scroll('+speed+')', 25);
}
pageScrollPane.prototype.stopScroll = function() {
	if(this.scrollTimer) {
		window.clearTimeout(this.scrollTimer);
		this.scrollTimer = null;
	}
}

var imageButtonFader = {
	prefix : 'dxBtn',
	imgEntry : {},
	mOverEntry : {},
	mOutEntry : {},
	transform : 'filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=.6,wipestyle=1,motion=reverse,duration=.3);',
	prepImages : function() {
		if(clientEnvironment.isW3C) {
			var inputimgs = document.getElementsByTagName('input');
			for(var i=0; i<inputimgs.length; i++) {
				if(inputimgs[i].type == 'image' && inputimgs[i].id.indexOf(imageButtonFader.prefix) != -1) {
					var tgt = inputimgs[i];
					var fmt = tgt.src.substring(tgt.src.lastIndexOf('.'));
					tgt.style.filter = (clientEnvironment.isIE && this.transform) ? this.transform : '' ;
					this.mOverEntry[tgt.name+'_Over'] = new Image();
					this.mOverEntry[tgt.name+'_Over'].src = tgt.src.substring(0, tgt.src.lastIndexOf('.')-1)+'2'+fmt;
					this.mOutEntry[tgt.name+'_Out'] = new Image();
					this.mOutEntry[tgt.name+'_Out'].src = tgt.src.substring(0, tgt.src.lastIndexOf('.')-1)+'1'+fmt;
					this.imgEntry[tgt.name] = new fadeHandler();
					snippets.attachEventMethods(tgt, 'onmouseover', 'imageButtonFader.imgEntry[this.name].mOver(this);');
					snippets.attachEventMethods(tgt, 'onmouseout', 'imageButtonFader.imgEntry[this.name].mOut(this);');
					snippets.attachEventMethods(tgt, 'onfocus', 'this.blur();');
				} else if(inputimgs[i].type == 'image') {
					var tgt = inputimgs[i];
					snippets.attachEventMethods(tgt, 'onfocus', 'this.blur();');
				}
			}
			var imgs = document.getElementsByTagName('img');
			for(var i=0; i<imgs.length; i++) {
				if(imgs[i].id.indexOf(imageButtonFader.prefix) != -1) {
					var tgt = imgs[i];
					var fmt = tgt.src.substring(tgt.src.lastIndexOf('.'));
					tgt.style.filter = (clientEnvironment.isIE && this.transform) ? this.transform : '' ;
					this.mOverEntry[tgt.id+'_Over'] = new Image();
					this.mOverEntry[tgt.id+'_Over'].src = tgt.src.substring(0, tgt.src.lastIndexOf('.')-1)+'2'+fmt;
					this.mOutEntry[tgt.id+'_Out'] = new Image();
					this.mOutEntry[tgt.id+'_Out'].src = tgt.src.substring(0, tgt.src.lastIndexOf('.')-1)+'1'+fmt;
					this.imgEntry[tgt.id] = new fadeHandler();
					snippets.attachEventMethods(tgt, 'onmouseover', 'imageButtonFader.imgEntry["'+tgt.id+'"].mOver(this);');
					snippets.attachEventMethods(tgt, 'onmouseout', 'imageButtonFader.imgEntry["'+tgt.id+'"].mOut(this);');
				}
			}
			if(clientEnvironment.isIE) {
				var all = document.all;
				for(var i=0; i<all.length; i++) {
					if(all[i].id.indexOf(imageButtonFader.prefix) != -1) {
						var tgt = all[i];
						tgt.style.filter = (clientEnvironment.isIE && this.transform) ? this.transform : '' ;
						this.imgEntry[tgt.id] = new fadeHandler();
						snippets.attachEventMethods(tgt, 'onmouseover', 'imageButtonFader.imgEntry["'+tgt.id+'"].mOver(this);');
						snippets.attachEventMethods(tgt, 'onmouseout', 'imageButtonFader.imgEntry["'+tgt.id+'"].mOut(this);');
					}
				}
			}
		}
	}
}

var fadeHandler = function() { };
fadeHandler.prototype.mOver = function(tgt) {
	if(clientEnvironment.isW3C) {
		tgt.style.cursor = 'pointer';
 		if(clientEnvironment.isIE && imageButtonFader.transform && tgt.id.indexOf(imageButtonFader.prefix) != -1) {
			tgt.filters[0].apply();
			if(tgt.src) tgt.src = imageButtonFader.mOverEntry[tgt.id+'_Over'].src;
			tgt.filters[0].play();
		} else {
			if(tgt.src) tgt.src = imageButtonFader.mOverEntry[tgt.id+'_Over'].src;
		}
	}
}
fadeHandler.prototype.mOut = function(tgt) {
	if(clientEnvironment.isW3C) {
		tgt.style.cursor = 'default';
		if(clientEnvironment.isIE && imageButtonFader.transform && tgt.id.indexOf(imageButtonFader.prefix) != -1) {
			tgt.filters[0].apply();
			if(tgt.src) tgt.src = imageButtonFader.mOutEntry[tgt.id+'_Out'].src;
			tgt.filters[0].play();
		} else {
			if(tgt.src) tgt.src = imageButtonFader.mOutEntry[tgt.id+'_Out'].src;
		}
	}
}

var imageWiper = {
	imgs : {}, imgcnt : 4, timer : 6, current : 1, tgtimg: document.getElementById('wipeImage'),
	transform : 'filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=.4,WipeStyle=0,Motion=Forward,Duration=4);',
	loadCheck : function(next) {
		if(this.imgs['wipeImage'+next].loaded) {
			setTimeout('imageWiper.wipeImg()', imageWiper.timer*1000);
		} else {
			setTimeout('imageWiper.loadCheck('+(imageWiper.current+1)+')', 100);
		}
	},
	prepImg : function(next) {
		tgtimg.style.filter = (clientEnvironment.isIE && this.transform) ? this.transform : '' ;
		var fmt = tgtimg.src.substring(tgtimg.src.lastIndexOf('.'));

		for(var i=1; i<=this.imgcnt; i++) {
			this.imgs['wipeImage'+i] = new Image();
			this.imgs['wipeImage'+i].onload = function() {
				this.loaded = true;
			}
			this.imgs['wipeImage'+i].src = tgtimg.src.substring(0, tgtimg.src.lastIndexOf('.')-1)+i+fmt;
		}
		setTimeout('imageWiper.loadCheck('+(imageWiper.current+1)+')', 100);
	},
	wipeImg : function() {
		var next = (this.current == this.imgcnt) ? 1 : this.current+1 ;
		if(clientEnvironment.isIE && this.transform) {
			tgtimg.filters[0].apply();
			tgtimg.src = this.imgs['wipeImage'+next].src;
			tgtimg.filters[0].play();
		} else {
			tgtimg.src = this.imgs['wipeImage'+next].src;
		}
		this.current = next;
		next = (this.current == this.imgcnt) ? 1 : this.current+1 ;
		setTimeout('imageWiper.loadCheck('+next+')', 100);
	}
};

var windowLauncher = {
	openWin : function(url, name, width, height, xpos, ypos, chrome, scroll) {
		var x, y, w, h, moveX = 0, moveY = 0, features = '';
		var chrome = chrome ? 'yes' : 'no';
		var scroll = scroll ? 'yes' : 'no';
		features += 'toolbar='+chrome+',location='+chrome+',status=Yes,menubar'+chrome+',directories='+chrome;
		features += ',scrollbars='+scroll+',resizable='+scroll;
		if(width) features += ',width='+width;
		if(height) features += ',height='+height;
		if(xpos && window.screen) {
			w = window.screen.availWidth;
			width = parseInt(width);
			switch(xpos) {
				case 'left' : x = 0; break;
				case 'center' : x = (w-width)/2; break;
				case 'right' : x = w-width; break;
				default : x = xpos;
			}
			features += ',screenX='+x+',left='+x;
			var moveX = x;
		}
		if(ypos && window.screen) {
			h = window.screen.availHeight;
			height = parseInt(height);
			switch(ypos) {
				case 'top' : y = 0; break;
				case 'middle' : y = (h-height)/2; break;
				case 'bottom' : y = h-height; break;
				default : y = ypos;
			}
			features += ',screenY='+y+',top='+y;
			var moveY = y;
		}
		openWinReference = window.open(url, name, features);
		openWinReference.focus();
		if(moveX || moveY) {
			openWinReference.moveTo(moveX, moveY);
		}
	},
	openScroll : function(url, name, width, height) {
		this.openWin(url, name, width, height, false, false, false, 'scroll');
	},
	openCenter : function(url, name, width, height) {
		this.openWin(url, name, width, height, 'center', 'middle');
	},
	openCenterScroll : function(url, name, width, height) {
		this.openWin(url, name, width, height, 'center', 'middle', false, 'scroll');
	},
	openFull : function(url, name) {
		this.openWin(url, name, false, false, false, false, 'chrome', 'scroll');
	}
};

var preLoadFuncs = {
	entry : ['readQuery', 'fixMacIEOverflow'],
	readQuery : function() {
		for(i in pageQuery.vars) {
			if(pageQuery.vars['addPreLoadFuncs']) {
				var pairs = pageQuery.vars['addPreLoadFuncs'].split(';');
				for(var i=0; i< pairs.length; i++) {
					eval(pairs[i]);
				}
			}
		}
	},
	fixMacIEOverflow : function() {
		if(!clientEnvironment.isW3C) {
			if(clientEnvironment.isMacIE && clientEnvironment.isW3C){
				if(document.body.clientHeight > 500){
					document.getElementsByTagName('body')[0].style.overflow = 'hidden';
				}
			}
		}
	},
	launch : function() {
		for(i in preLoadFuncs.entry) {
			var prefix = (preLoadFuncs.entry[i].indexOf('.') != -1) ? '' : 'preLoadFuncs.' ;
			var postfix = (preLoadFuncs.entry[i].indexOf('(') != -1) ? '' : '()' ;
			eval(prefix+preLoadFuncs.entry[i]+postfix+';');
		}
	}
};

var onLoadFuncs = {
	entry : ['readQuery'],
	readQuery : function() {
		for(i in pageQuery.vars) {
			if(pageQuery.vars['addOnLoadFuncs']) {
				var pairs = pageQuery.vars['addOnLoadFuncs'].split(';');
				for(var i=0; i<pairs.length; i++) {
					eval(pairs[i]);
				}
			}
		}
	},
	launch : function() {
		for(i in onLoadFuncs.entry) {
			var prefix = (onLoadFuncs.entry[i].indexOf('.') != -1) ? '' : 'onLoadFuncs.' ;
			var postfix = (onLoadFuncs.entry[i].indexOf('(') != -1) ? '' : '()' ;
			eval(prefix+onLoadFuncs.entry[i]+postfix+';');
		}
	}
};
window.onload = onLoadFuncs.launch;

var onResizeFuncs = {
	entry : ['readQuery'],
	readQuery : function() {
		for(i in pageQuery.vars) {
			if(pageQuery.vars['addOnResizeFuncs']) {
				var pairs = pageQuery.vars['addOnResizeFuncs'].split(';');
				for(var i=0; i<pairs.length; i++) {
					eval(pairs[i]);
				}
			}
		}
	},
	launch : function() {
		for(i in onResizeFuncs.entry) {
			var prefix = (onResizeFuncs.entry[i].indexOf('.') != -1) ? '' : 'onResizeFuncs.' ;
			var postfix = (onResizeFuncs.entry[i].indexOf('(') != -1) ? '' : '()' ;
			eval(prefix+onResizeFuncs.entry[i]+postfix+';');
		}
	}
};
window.onresize = onResizeFuncs.launch;

var onUnLoadFuncs = {
	entry : ['readQuery'],
	readQuery : function() {
		for(i in pageQuery.vars) {
			if(pageQuery.vars['addOnUnLoadFuncs']) {
				var pairs = pageQuery.vars['addUnLoadFuncs'].split(';');
				for(var i=0; i<pairs.length; i++) {
					eval(pairs[i]);
				}
			}
		}
	},
	launch : function() {
		for(i in onUnLoadFuncs.entry) {
			var prefix = (onUnLoadFuncs.entry[i].indexOf('.') != -1) ? '' : 'onUnLoadFuncs.' ;
			var postfix = (onUnLoadFuncs.entry[i].indexOf('(') != -1) ? '' : '()' ;
			eval(prefix+onUnLoadFuncs.entry[i]+postfix+';');
		}
	}
};
window.onunload = onUnLoadFuncs.launch;

