function start(rootpath)
{
document.writeln('<div id="innerbody">')
document.writeln('<a name="top"></a>')
document.writeln('<img src="' + rootpath + 'banner.png">')
main_menu(rootpath)
}

function finish(rootpath)
{
document.write('<p class="menu"><br>')
document.write('<a href="#top"><img src="' + rootpath + 'button-page-top.png"></a>')
document.write('<a href="' + rootpath + 'index.html"><img src="' + rootpath + 'button-home.png"></a>')
document.writeln('<a href="' + rootpath + 'contact/index.html"><img src="' + rootpath + 'button-contact.png"></a></p>')
document.writeln('<p class="footnote">Second Life and the inSL logo are trademarks of Linden Research, Inc.')
document.writeln('<br>Bright Corporation is not affiliated with or sponsored by Linden Research.</p>')
document.writeln('</div>')
}

function main_menu(rootpath)
{
document.write('<p class="menu">')
document.write('<a href="' +  rootpath + 'index.html"><img src="' + rootpath + 'button-home.png"></a>')
document.write('<a href="' +  rootpath + 'gadgets/index.html"><img src="' + rootpath + 'button-products.png"></a>')
document.write('<a href="' +  rootpath + 'freebies/index.html"><img src="' + rootpath + 'button-freebies.png"></a>')
document.write('<a href="' +  rootpath + 'custom/index.html"><img src="' + rootpath + 'button-custom.png"></a>')
document.write('<br><a href="' +  rootpath + 'rentals/index.html"><img src="' + rootpath + 'button-rentals.png"></a>')
document.write('<a href="' +  rootpath + 'shops/index.html"><img src="' + rootpath + 'button-shops.png"></a>')
document.write('<a href="' +  rootpath + 'sandbox/index.html"><img src="' + rootpath + 'button-sandbox.png"></a>')
document.write('<a href="' +  rootpath + 'usergroup/index.html"><img src="' + rootpath + 'button-company.png"></a>')
document.writeln('</p>')
}

function home_menu(rootpath)
{
document.write('<p class="menu">')
document.write('<a href="' +  rootpath + 'index.html"><img src="' + rootpath + 'button-latest.png"></a>')
document.write('<a href="' +  rootpath + 'index-2010.html"><img src="' + rootpath + 'button-2010.png"></a>')
document.write('<a href="' +  rootpath + 'index-2009.html"><img src="' + rootpath + 'button-2009.png"></a>')
document.write('<br><a href="' +  rootpath + 'index-2008.html"><img src="' + rootpath + 'button-2008.png"></a>')
document.write('<a href="' +  rootpath + 'index-2007.html"><img src="' + rootpath + 'button-2007.png"></a>')
document.writeln('</p>')
}

function products_menu(rootpath)
{
document.write('<p class="menu">')
document.write('<a href="' +  rootpath + 'gadgets/index.html"><img src="' + rootpath + 'button-gadgets.png"></a>')
document.write('<a href="' +  rootpath + 'business/index.html"><img src="' + rootpath + 'button-business.png"></a>')
document.write('<a href="' +  rootpath + 'vehicles/index.html"><img src="' + rootpath + 'button-vehicles.png"></a>')
document.write('<a href="' +  rootpath + 'buildings/index.html"><img src="' + rootpath + 'button-buildings.png"></a>')
document.write('<br><a href="' +  rootpath + 'furnishing/index.html"><img src="' + rootpath + 'button-furnishing.png"></a>')
document.write('<a href="' +  rootpath + 'art/index.html"><img src="' + rootpath + 'button-art.png"></a>')
document.write('<a href="' +  rootpath + 'adult/index.html"><img src="' + rootpath + 'button-adult.png"></a>')
document.writeln('</p>')
}

function products_return_menu(rootpath, category)
{
document.writeln('<p><span class="picture"><a href="' +  rootpath + category + '/index.html"><img src="' + rootpath + 'button-' + category + '.png"></a></span>(Click for the full ' + category + ' product list)</p>')
}

function company_menu(rootpath)
{
document.write('<p class="menu">')
document.write('<a href="' +  rootpath + 'usergroup/index.html"><img src="' + rootpath + 'button-usergroup.png"></a>')
document.write('<a href="' +  rootpath + 'dealerships/index.html"><img src="' + rootpath + 'button-dealerships.png"></a>')
document.write('<br><a href="' +  rootpath + 'feedback/index.html"><img src="' + rootpath + 'button-feedback.png"></a>')
document.write('<a href="' +  rootpath + 'analysis/index.html"><img src="' + rootpath + 'button-analysis.png"></a>')
document.write('<a href="' +  rootpath + 'contact/index.html"><img src="' + rootpath + 'button-contact.png"></a>')
document.writeln('</p>')
}

function category(name)
{
document.writeln('<p>Below, you will see products from our ' + name + ' range.')
document.writeln('<p>All Bright products are sold with copy rights, but may not be transferred. If you are buying for someone else, SL Marketplace offers a gift delivery service, and there is a gift-enabled vendor in our Megashop.</p><p>&nbsp</p>')
}

function product(name, address, price, description, slmarketplace, local)
{
document.writeln('<tr>')
document.writeln('<td><img class="inset" src="../' + address + '/label.png"></td>')
document.writeln('<td class="spaced-box">')
if (price == '0')
{
    price = 'FREE'
}
document.writeln('<p><strong>Bright ' + name + '</strong></p>')
document.writeln('<p>Price: $' + price + '</p>')
document.writeln('<p>' + description + '</p>')
if (local == undefined)
{
	document.writeln('<p><a href="../' + address + '/index.html">See product page</a></p>')
}
if (slmarketplace != '')
{
	document.writeln('<p><a href="' + slmarketplace_url(slmarketplace) + '" target="_blank">See on SL Marketplace</a></p>')
}
document.writeln('</td>')
document.writeln('</tr>')
document.writeln('<tr>')
}

function product_buttons(product, slmarketplace)
{
if (product != "")
{
    document.writeln('<p><a href="' + product + '" target="_blank"><img src="../pdfbutton.png"></a></p>')
}
if (slmarketplace != "")
{
    document.writeln('<p><a href="' + slmarketplace_url(slmarketplace) + '" target="_blank"><img src="../slmarketplace.png"></a></p>')
}
}

function slmarketplace_url(slmarketplace)
{
return 'https://marketplace.secondlife.com/p/bright-corporation/' + slmarketplace
}

function slurl(name, region, x, y, z, logo)
{
document.writeln('<tr><td><p>' + name + '</p></td><td class="spaced-box"><p>')
slurl_link('', region, x, y, z, logo)
document.writeln('</p></td></tr>')
}

function slurl_link(name, region, x, y, z, logo)
{
if (logo == undefined)
    logo = "logo";
code = '<a href="http://slurl.com/secondlife/'
code += region + '/' + x + '/' + y + '/' + z
code += '?title=Bright%20Corporation'
code += '&img=http%3A//brightcorporation.net/' + logo + '.png" target="_blank">'
if (name != '')
{
	code += name + ' ('
}
code += region + ' ' + x + ','+ y + ',' + z
if (name != '')
{
	code += ')'
}
document.writeln(code + '</a>')
}

function webshop(name, shorturl, url)
{
document.writeln('<tr><td><p>' + name + '</p></td>')
document.writeln('<td class="spaced-box"><p><a href="' + url + '" target="_blank">' + shorturl + '</a></p></td></tr>')
}

function link(name, url, notes)
{
document.writeln('<tr><td><p><strong>' + name + '</strong></br><a href="http://')
document.writeln(url + '" target="_blank">' + url + '</a></td><td class="spaced-box"><p>' + notes + '</p></td></tr>')
}

function feedback(heading, date, product, author, text)
{
document.writeln('<h2>' + heading + '</h2>')
document.writeln('<p><em>' + product + ' [' + author + ', ' + date + ']</em><br>' + text  + '</p>')
}

