////////////////////////////////////////////////////////////////////////////////////////
// "Tab setup" extension to iTab applets (version 1.0)
// (c) Image Intelligence Software Ltd. 2001
//
// This is copyrighted software - read the licence agreement
//
// DO NOT CHANGE ANYTHING IN THIS FILE OR THE APPLET WON'T WORK!
// (OK, if you think you're good, you can change the code below, but don't contact us 
// if you do, as it automatically voids all support entitlement for the whole product)
// (OK, if you're really, really good, and you think you have improved the code below,
// send it to us and we may reinstate your support entitlement for the applet)
// 
// When implementing this file in your HTML page, use the syntax
//
//	writeTabs(numberOfTabs, heightOfApplet)
// e.g.
//	writeTabs(9,47)
// ensuring that these numbers coincide with the way you have set up the applet.
//
// If you don't like the way this code requires the pages to have the names
// page0.html, page1.html, page2.html, etc, then try the following:
// replace the 2 loops with individual code for each page, and set the
// value of src to your preferred page names.
// 
////////////////////////////////////////////////////////////////////////////////////////



	function writeTabs(numberOfTabs, heightOfApplet)
	{
		output = "";	
		if (navigator.appName=="Netscape")
		{
			tp = " top=" + heightOfApplet;
			for (i=numberOfTabs; i>=0; i--)
			{
				
				src = " src=page" + i + ".html";
				id = " name=tab" + i;
				vis = (i==0) ? " visibility=show" : " visibility=hide";
				output += "<layer" + tp + " width=100% height=100% " + id + src + vis + "></layer>";	
			}
		}
		else
		{
			h = document.body.clientHeight - heightOfApplet;
			ht = "height=" + h + ";"; 
			tp = "top:" + heightOfApplet + ";";
			for (i=numberOfTabs; i>=0; i--)
			{
				src = "src=page" + i + ".html";
				id = " id=tab" + i;
				name = " name=frame" + i;
				style = " style='position:absolute; " + tp + " visibility:visible; width=100%; " + ht + "'";
				output += "<div " + id + style + ">";
				output += "<iframe " + src + name + " align=top width=100% " + ht + " frameborder=no></iframe>";
				output += "</div>";	
			}
		}
		
		document.write(output);

	}
	





