
	function FancyLine()
	{
	    this.x = 0;
	    this.y = 0;
		this.width = 0;
		this.height = 0;
		this.position = "relative";
		this.name = "";
		this.index = 0;
		this.borderwidth = 0;
		this.leftimage = "";
		this.middleimage = "";
		this.rightimage = "";
		this.parentDiv = 'myDiv';
	}
	
	FancyLine.prototype.BuildMe = function(){

		var txt = document.createElement("div");
		this.htmlelement = txt;
		document.getElementById(this.parentDiv).appendChild(txt);
		this.PaintMe();
	}
	
	FancyLine.prototype.PaintMe = function()
	{
	
		if (typeof document.body.style.maxHeight != "undefined") {
		} else {
			this.leftimage = this.leftimage.replace(".png",".gif");
			this.middleimage = this.middleimage.replace(".png",".gif");
			this.rightimage = this.rightimage.replace(".png",".gif");
		}
	
		var divText;
		divText = "<div id='Line" + this.index + "' ";
		divText += "style=\"";
		divText += "position:" + this.position + ";";
		divText += "left:" + this.x + ";";
		divText += "top:" + this.y + ";";
		if(this.width>0){
			divText += "width:" + this.width + ";";
		}
		if(this.height>0){
			divText += "height:" + this.height + ";";
		}
		divText += "float:left;";
		divText += "\">";

		divText += this.BuildBorder();
		divText += "</div>";
		
		this.htmlelement.innerHTML = divText;
	}
	
	
	FancyLine.prototype.BuildBorder = function()
	{
		
		var buildhtml;
		var borderwidthdiff;
		var tempborderwidth;
		buildhtml = "";
		
		tempborderwidth = this.borderwidth;

		borderwidthdiff = this.width - (this.borderwidth*2);
		if(borderwidthdiff<0){
			tempborderwidth = this.borderwidth + (borderwidthdiff/2);
		}
		
		//Top Row
		buildhtml+= "<div style=\"position:absolute; left:0px; top:0px; width:"+tempborderwidth+"px; height:"+this.height+"px; background-image:url("+this.leftimage+"); background-repeat: repeat-x; \"></div>";
		if(borderwidthdiff>0){
			buildhtml+= "<div style=\"position:absolute; left:"+tempborderwidth+"px; top:0px; width:"+borderwidthdiff+"px; height:"+this.height+"px; background-image:url("+this.middleimage+"); background-repeat: repeat-x; \"></div>";
		}
		buildhtml+= "<div style=\"position:absolute; left:"+(this.width-tempborderwidth)+"px; top:0px; width:"+tempborderwidth+"px; height:"+this.height+"px; background-image:url("+this.rightimage+"); background-repeat: repeat-x; \"></div>";

		return buildhtml;
	}
	

