function Guestbook(sUser, divTitle, imgPath, sPageColor)
{

	var ie=document.all;
	var ns6=document.getElementById&&!document.all;

	//this.path = "../webtranscend/customer/"; //development

	//this.path = "http://localhost/webtranscend/customer/"; //development
	this.path = "http://www.webtranscend.com/customer/"; //production

	this.pagename = "GuestbookUpdate.aspx"

	this.sName = new Array();
	this.sTitle = new Array();
	this.sCompany = new Array();
	this.sWebsite = new Array();
	this.sGuestDate = new Array();
	this.sEmail = new Array();
	this.sLocation = new Array();
	this.sComment = new Array();
	this.iCommentCount = 0;
	this.UserId = sUser;
	this.pageColor = sPageColor;

	if (imgPath == "")
		imgPath = "Message/";

	this.imgPath = imgPath;
	this.divTitle = divTitle;


	this.GetObject = function (sName)
	{

		var oDiv = ns6? document.getElementById(sName) : document.all(sName);
		return oDiv;
	}

	this.GetUser = function()
	{
		return this.UserId;
	}

	this.ImagePath = function()
	{
		return this.imgPath;
	}

	this.PageColor = function()
	{
		return this.pageColor;
	}

	this.DisplayGuestBook = function (sDiv)
	{
		var i;
		var iMax = this.iCommentCount - 1;

		var sDisplayText = "";

		var oDiv = this.GetObject(sDiv);

		sDisplayText = "<div id='divGB' class='gb'><table>";

		for(i=0;i<=iMax; i++)
		{

				sDisplayText += "<tr><th class='gb'>Name</th><td class='gb'>" + this.sName[i] + " (" + this.sGuestDate[i] + ")</td></tr>";

				if (this.sTitle[i] != "")
					sDisplayText += "<tr><th class='gb'>Title</th><td class='gb'>" + this.sTitle[i] + "</td></tr>";

				if (this.sCompany[i] != "")
					sDisplayText += "<tr><th class='gb'>Company</th><td class='gb'>" + this.sCompany[i] + "</td></tr>";

				if (this.sWebsite[i] != "")
					sDisplayText += "<tr><th class='gb'>Website</th><td class='gb'>" + this.sWebsite[i] + "</td></tr>";

				if (this.sEmail[i] != "")
					sDisplayText += "<tr><th class='gb'>eMail</th><td class='gb'>" + this.sEmail[i] + "</td></tr>";

				if (this.sLocation[i] != "")
					sDisplayText += "<tr><th class='gb'>Location</th><td class='gb'>" + this.sLocation[i] + "</td></tr>";

				sDisplayText += "<tr><th class='gb'>Comment</th><td class='gb'>" + this.sComment[i] + "</td></tr>";

				sDisplayText += "<tr><td colspan='2'><hr class='gb' width='100%'></td></tr>";

		}

		sDisplayText +=  "</table>";
		sDisplayText +=  "<a class='gb' href='javascript:GoTop()'>TOP</a>";
		sDisplayText +=  "</div>";

		oDiv.innerHTML = sDisplayText;
		oDiv.style.display = "";

		if (this.iCommentCount < 1)
			oDiv.style.display = "none";

	}

	this.AddComment = function (aGuestDate, aName, aEmail, aLocation, aTitle, aCompany, aWebsite, aComment)
	{
		this.sName[this.iCommentCount] = aName;
		this.sGuestDate[this.iCommentCount] = aGuestDate;
		this.sEmail[this.iCommentCount] = aEmail;
		this.sLocation[this.iCommentCount] = aLocation;
		this.sComment[this.iCommentCount] = aComment;

		this.sTitle[this.iCommentCount] = aTitle;
		this.sCompany[this.iCommentCount] = aCompany;
		this.sWebsite[this.iCommentCount] = aWebsite;

		this.iCommentCount = this.iCommentCount + 1;
	}

}


function GuestbookForm(sUserId, sImgPath, sPageColor)
{
	var iW = 650;
	var iH = 550;
	//alert(".js: " + sImgPath);
	//var oWin = open("http://localhost/webtranscend/customer/guestbookform.html?ImgPath=" + sImgPath + "&UserId=" + sUserId + "&PageColor=" + sPageColor,"PopUp","width=" + iW + ", height=" + iH);
	var oWin = open("http://www.webtranscend.com/customer/guestbookform.html?ImgPath=" + sImgPath + "&UserId=" + sUserId + "&PageColor=" + sPageColor,"PopUp","width=" + iW + ", height=" + iH);
	oWin.focus();

}

