haze = {
col:'silver', lN:10, lW:1, oSide:50, oMid:100, stick:'left', shift:0, opacFnName:'this._calcLinear(arr)', coverPad: 0, mid:0, hW:0, coverBord:0,
_setOpac : function (arr) {eval(this.opacFnName)},
_calcBalanced : function (arr){
	var opacStep = Math.ceil(this.oMid - this.oSide)/Math.ceil(this.lN/2-1);
	var opac, k;
	for (var i=0; i<arr.length; i++) {
		k = (i<=arr.length/2) ? i : arr.length-i-1;
		opac = Math.round(this.oSide+k*opacStep);
		arr[i].style.opacity = opac/100;
		arr[i].style.filter = 'alpha(opacity='+opac+')';
	}
},
_calcLinear : function (arr){
	var midL = Math.round((this.mid+1)/2*this.lN-0.5); if (midL==this.lN) midL--;
	var step = (this.oMid-this.oSide)/midL;
	var op = this.oSide;
	for (var i=0; i<midL; i++){
		op = this.oSide+i*step;
		arr[i].style.opacity = op/100;
		arr[i].style.filter = 'alpha(opacity='+op+')';
	}
	step = (this.lN-1-midL==0) ? 0 : (this.oMid-this.oSide)/(this.lN-1-midL);
	op = this.oMid; 
	for (var i=midL; i<this.lN; i++){
		op = this.oMid-(i-midL)*step;
		arr[i].style.opacity = op/100;
		arr[i].style.filter = 'alpha(opacity='+op+')';
	}
},
setDefault : function() {this.col='silver'; this.lN=10; this.lW=1; this.oSide=50; this.oMid=100; this.stick='left'; this.shift=0; this.opacFnName='this._calcBalanced(arr)'; this.coverPad= 0; hW:0},
setColor : function (c){this.col=c},
setSticking : function (c) {if(/^(left|top|right|bottom){1}$/.test(c)) {this.stick=c; return 1} return 0},
setHazeDiv : function (W,w) {if(W>0 && w>0){this.hW=W; this.lW=w; return 1} return 0},
setShift : function (s) {s=parseFloat(s); if (!isNaN(s)) {this.shift=s; return 1} return 0},
setLines : function (n,w) {if(w>0 && n>0){this.lW=w; this.lN=n; this.hW=0; return 1} return 0},
setOpacRange : function (s,m){s=parseFloat(s); m=parseFloat(m); if (!isNaN(s) && !isNaN(m)) {this.oSide=s; this.oMid=m; return 1} return 0},
setOpacMid : function (c){if (parseFloat(c)){this.mid = c<-1 ? -1:c; this.mid = c>1 ? 1:c; return 1} return 0},
setOpacFn : function (c) {if(/^(calcBalanced|calcLinear){1}$/.test(c)){this.opacFnName='this._'+c+'(arr)'; return 1} return 0},
coverPadding : function (c){if(/^(0|1){1}$/.test(c)) {this.coverPad=c;return 1}return 0},
coverBorder : function (c){if(/^(0|1){1}$/.test(c)) {this.coverPad=c;this.coverBord=c;return 1}return 0},
_changeColor : function (c){
	c.toString();
	for (var i=0; i<this.childNodes.length; i++) this.childNodes[i].style.backgroundColor=c;
	return 1
},
_changeLineWidthTo : function (c,a){
	c=parseInt(c);
	if(isNaN(c)) return 0;
	var s=this.stick;
	var cross = (s=='left' || s=='right') ? 'width':'height';
	for (var i=0; i<this.childNodes.length; i++){
		this.childNodes[i].style[cross]=c;
		if(a)this.childNodes[i].style[s]=i*c+'px'
	}
	return 1
},
_changeOpacBy : function (c){
	c=parseFloat(c);
	var o;
	for (var i=0; i<this.childNodes.length; i++){
		o=this.childNodes[i].style;
		o.opacity=parseFloat(o.opacity)+c/100;
		o.filter = 'alpha(opacity='+100*o.opacity+')';
	}
	return 1
},
_padding : function (host,s,tall,cross) {
	var padT=padR=padL=padB=0;
	var bordT=bordR=bordB=bordL=0;
	var tallVal, crossVal;
	function cs(v){return parseInt(c.getPropertyValue(v))}
		if (tall=='height') {
			tallVal = parseInt(host.offsetHeight);
			crossVal = parseInt(host.offsetWidth);
		} else {
			tallVal = parseInt(host.offsetWidth);
			crossVal = parseInt(host.offsetHeight);
		}
	if (host.currentStyle){
		var c = host.currentStyle;
		bordT = parseInt(c.borderTopWidth)||0;
		bordR = parseInt(c.borderRightWidth)||0;
		bordB = parseInt(c.borderBottomWidth)||0;
		bordL = parseInt(c.borderLeftWidth)||0;
		if (tall=='height') {tallVal-=bordT+bordB; crossVal-=bordL+bordR} else {tallVal-=bordL+bordR; crossVal-=bordT+bordB}
		if (!this.coverPad){
			padT = parseInt(c.paddingTop)||0;
			padL = parseInt(c.paddingLeft)||0;
			padR = parseInt(c.paddingRight)||0;
			padB = parseInt(c.paddingBottom)||0;
			if (tall=='height') {tallVal-=padT+padB; crossVal-=padL+padR} else {tallVal-=padL+padR; crossVal-=padT+padB}
		}
	} else {
		var c = document.defaultView.getComputedStyle(host, '');
		padT = cs('padding-top');
		padR = cs('padding-right');
		padB = cs('padding-bottom');
		padL = cs('padding-left');
		if (this.coverPad){
			if (tall=='height') {tallVal+=padT+padB; crossVal+=padL+padR} else {tallVal+=padL+padR;	crossVal+=padT+padB}
			padT=0; padR=0; padL=0; padB=0;
		}
		if (this.coverBord){
			bordT = cs('border-top-width');
			bordR = cs('border-right-width');
			bordB = cs('border-bottom-width');
			bordL = cs('border-left-width');
		}
	}
	if (this.coverBord){
		if (tall=='height') {tallVal+=bordT+bordB; crossVal+=bordL+bordR} else {tallVal+=bordL+bordR; crossVal+=bordT+bordB}
		padT=-bordT; padR=-bordR; padL=-bordL; padB=-bordB;
	}
	var padShift=0;
	switch (this.stick) {
	   case 'left': padShift = padL; s.top = padT +'px'; break;
	   case 'right': padShift = padR; s.top = padT +'px'; break;
	   case 'top': padShift = padT; s.left = padL +'px'; break;
	   case 'bottom' : padShift = padB; s.left = padL +'px'; break;
	}
	s[this.stick] = (this.shift+padShift)+'px';
	s[tall] = tallVal+'px';
	if (this.hW) {
		var w = Math.round(this.hW/100*crossVal);
		this.lN = 1; while (this.lN*this.lW < w)this.lN++;
		s[cross]=w;
	} else s[cross]=this.lN*this.lW;
},
addHazeTo : function (host, id) {
	switch (this.stick) {
	   case 'left':;
	   case 'right' : var cross = 'width'; var tall = 'height'; break;
	   case 'top':;
	   case 'bottom' : var cross = 'height'; var tall = 'width'; break;
	   default : return 0;
	}
	var hazeDiv = document.createElement('div');
	if (id){hazeDiv.setAttribute('id', id)}
	var s = hazeDiv.style;
	this._padding(host,s,tall,cross);
	s.position = 'absolute';
	s.overflow='hidden';
	hazeDiv.cross = cross;
	hazeDiv.stick = this.stick;
	for (var i=0; i<this.lN; i++) {
		el = document.createElement('div');
		el.style[this.stick] = i*this.lW + 'px';
		el.style.position = 'absolute';
		el.style[cross] = this.lW + 'px';
		el.style[tall] = s[tall];
		el.style.backgroundColor = this.col;
		el.style.overflow='hidden'; //IE defaults to larger height
		hazeDiv.appendChild(el);
	}
	this._setOpac(hazeDiv.childNodes);
	hazeDiv.changeColor = this._changeColor;
	hazeDiv.changeLineWidthTo = this._changeLineWidthTo;
	hazeDiv.changeOpacBy = this._changeOpacBy;
 	host.appendChild(hazeDiv);
	return hazeDiv;
}
}

