// Custom functions - not part of library but per site
function whereAmI(){
	var curline = document.getElementById('curline');
	if(curline) {
			var containerwidth=curline.parentNode.offsetWidth-8;
			var curleft=getAbsLeft(curline)-getAbsLeft(curline.parentNode);
			curline.width=(containerwidth-curleft);
			curline.height=1;
	}
}

function writeFadeBox(id, x, y, width, height, fadeWidth, backgroundColor, color, content) {
	var container = document.createElement('div');
	container.id = id;
	var bodytags = document.getElementsByTagName('body');
	bodytags[0].appendChild(container);
	container=document.getElementById(id);
	container.style.cssText = 'z-index: 1; position: absolute; left: '+x+'px; top: '+y+'px; height: '+height+'px; width: '+width+'px;';
	
	var html='';
	if(container.filters) {
		var alphaBkSolid = '#FF'+backgroundColor.replace(/#/g,'');
		var alphaBkTrans = '#00'+backgroundColor.replace(/#/g,'');
		html+='<div style="position: absolute; left: 0px; top: 0px; width: '+fadeWidth+'px; height: '+height+'px; '
				+'filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=1, StartColorStr=\''+alphaBkTrans+'\', EndColorStr=\''+alphaBkSolid+'\')"></div>';
 	} else {
		for(var col=0; col<fadeWidth;col++) {
			var opacity = col/fadeWidth;
			html+='<div style="position: absolute; left: '+col+'px; top: 0px; width: 1px; height: '+height+'px; '
				+'background-color: '+backgroundColor+'; -moz-opacity: '+opacity+';filter:alpha(opacity='+(opacity*100)+'); "></div>\n';
		}
	}
	if(fadeWidth<width) {
		html+='<div style="position: absolute; left: '+fadeWidth+'px; top: 0px; width: '+(width-fadeWidth)+'px; height: '+height+'px; '
			+' overflow: hidden; background-color: '+backgroundColor+'; "></div>\n';
	}
	html+='<div style="position: absolute; text-align: left; font-size: 12px; color: '+color+'; left: '+((fadeWidth/2)+10)+'px; top: 0px; width: '+(width-((fadeWidth/2)+10))+'px; height: '+height+'px;padding: 8px;">'+content+'</div>';
	container.innerHTML=html;
	
}
function newwriteFadeBox(id, x, y, width, height, fadeWidth, backgroundColor, color, content) {
	var container = document.createElement('div');
	container.id = id;
	var bodytags = document.getElementsByTagName('body');
	bodytags[0].appendChild(container);
	container=document.getElementById(id);
	container.style.cssText = 'z-index: 1; position: absolute; left: '+x+'px; top: '+y+'px; height: '+height+'px; width: '+width+'px;';
	
	var html='';
	html+='<div style="position: absolute; text-align: left; font-size: 12px; color: '+color+'; left: '+((fadeWidth/2)+10)+'px; top: 0px; width: '+(width-((fadeWidth/2)+10))+'px; height: '+height+'px;padding: 8px;">'+content+'</div>';
	container.innerHTML=html;
	
}
/* End fade box */


