var g_strImageDir="images";
var g_strStyleDir="style";

var g_nMenu=0;
var g_nSubMenu=0;
var g_aMenu=new Array();
g_aMenu[g_nMenu++]={name:"Home",url:"index.htm",submenu:null};
g_aMenu[g_nMenu]={name:"Products",url:"products.htm",submenu:new Array()};
	g_aMenu[g_nMenu].submenu[0]={name:"Alive",url:"alive/index.htm",submenu:null};
	g_aMenu[g_nMenu].submenu[1]={name:"Progenie",url:"progenie/index.htm",submenu:null};
	g_aMenu[g_nMenu].submenu[2]={name:"AudioSpace",url:"audiospace/index.htm",submenu:null};
	g_aMenu[g_nMenu++].submenu[3]={name:"Mixer",url:"mixer/index.htm",submenu:null};
g_aMenu[g_nMenu++]={name:"Downloads",url:"downloads.htm",submenu:null};
g_aMenu[g_nMenu++]={name:"Support",url:"support.htm",submenu:null};
g_aMenu[g_nMenu++]={name:"Contact",url:"contact.htm",submenu:null};
g_aMenu[g_nMenu++]={name:"Search",url:"search.htm",submenu:null};
g_aMenu[g_nMenu++]={name:"Books",url:"associate/books.htm",submenu:null};
g_aMenu[g_nMenu++]={name:"Hardware",url:"associate/hardware.htm",submenu:null};
g_aMenu[g_nMenu++]={name:"Links",url:"links.htm",submenu:null};




function fnO(strOut)
{
	document.write(strOut);
}
function fnEAHREF(strUser,strDomain,strTop)
{
	fnO("<A HREF=\"");
	fnO("mai");
	fnO("lto:");
	fnO(strUser);
	fnO("@");
	fnO(strDomain);
	fnO(".");
	fnO(strTop);
	fnO("\">");
}
function fnEA(strUser,strDomain,strTop)
{
	fnO("<A HREF=\"");
	fnO("mai");
	fnO("lto:");
	fnO(strUser);
	fnO("@");
	fnO(strDomain);
	fnO(".");
	fnO(strTop);
	fnO("\">");
	fnO(strUser);
	fnO("@");
	fnO(strDomain);
	fnO(".");
	fnO(strTop);
	fnO("</A>");
}
function fnDoInfoNote()
{
	fnO("<P class=pagetext><b>Please Note:</b>&nbsp;");
	fnO("Information collected by SoundFaction will NOT be provided to third parties.");
	fnO("The information you provide will be used solely to help us keep in touch with you.");
	fnO("Please consult our <A HREF=/privacy.htm><B>Privacy Policy</B></A> for more information.");
}

function fnBoxOpen(strTopImage,strWidth,strHeight,strLineColor,strBGColor)
{
	fnO("<table valign=top width="+strWidth+"  border=0 cellspacing=0 cellpadding=0 >");
	fnO("<tr><td>");
	if (strTopImage!=null)
	  fnO("<TABLE  bgcolor=#"+strLineColor+" WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0><TR><TD background=images/boxtopleft.gif></TD><TD><img src="+strTopImage+" height=16 hspace=0 vspace=0 border=0></TD><TD background=images/boxtopright.gif></TD></TR></TABLE>");
	fnO("</td></tr><tr><td><table valign=top align=center width=100% height="+strHeight+" border=0 cellspacing=0 bgcolor=#"+strLineColor+">");
	fnO("<tr><td><table  class=boxtext valign=top  align=center width=100% height=100% border=0 cellpadding=6 cellspacing=0 bgcolor=#"+strBGColor+">");
	fnO("<tr><td  valign=center>");
}
function fnBoxClose()
{
	fnO("<td></tr></table></td></tr></table></td></tr></table>");
}
function fnBox(strTopImage,strWidth,strHeight,strLineColor,strBGColor, strContents)
{
	fnBoxOpen(strTopImage,strWidth,strHeight,strLineColor,strBGColor);
	fnO(strContents);
	fnBoxClose();
}


function fnShadL(strImageDir)
{
      fnO("<td width=4 background="+strImageDir+"/shadl.gif><img src="+strImageDir+"/shadl.gif width=10 height=10 hspace=0 vspace=0 /></td>");
}
function fnShadR(strImageDir)
{
	fnO("<td width=4 background="+strImageDir+"/shadr.gif><img src="+strImageDir+"/shadr.gif width=10 height=10 hspace=0 vspace=0 /></td>");
}
function fnDoHeader(d,strRoot)
{
	var strImageDir = strRoot+"/"+g_strImageDir+"/";
	fnO("<LINK type=text/css  rel=stylesheet href=\""+strRoot+"/"+g_strStyleDir+"/page.css\">");
	fnO("</HEAD>");
	
	fnO("<BODY class=\"pageborder\" TOPMARGIN=8 LEFTMARGIN=0 RIGHTMARGIN=0 >");
	
	fnO("<div align=\"center\">");
	fnO("<TABLE width=760 border=0 cellpadding=0 cellspacing=0>");
	
	fnO("<tr>");
      	fnO("<td width=4><img src="+strImageDir+"/shadtl.gif width=10 height=10 hspace=0 vspace=0 /></td>");
	fnO("<td height=4 background=\""+strImageDir+"/shadt.gif\"><img src="+strImageDir+"/shadt.gif width=20 height=10 hspace=0 vspace=0 /></td>");
      	fnO("<td width=4><img src="+strImageDir+"/shadtr.gif width=10 height=10 hspace=0 vspace=0 /></td>");
    	fnO("</tr>");
	
	fnO("<tr>");
	fnShadL(strImageDir);
      	fnO("<td >");
	
	fnO("<TABLE class=\"banner\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><TR>");
	fnO("<TD width=53 align=\"left\">");
	fnO("<IMG width=53 ALIGN=\"left\" SRC=\""+strRoot+"/"+g_strImageDir+"/logo_corner.gif\" BORDER=\"0\">");
	fnO("</TD><TD align=\"left\">");
	fnO("<IMG ALIGN=\"left\" SRC=\""+strImageDir+"/soundfaction.gif\" BORDER=\"0\">");
	fnO("</TD><TD align=\"right\">");
	fnO("<IMG ALIGN=\"right\" SRC=\""+strImageDir+"/banner.gif\" BORDER=\"0\">");
	fnO("</TD></TR>");
	fnO("</TABLE>");
	
		
      	fnO("</td>");
	fnShadR(strImageDir);
	fnO("</tr>");
	
	fnO("<tr>");
      	fnO("<td width=4 background="+strImageDir+"/shadl.gif><img src="+strImageDir+"/shadl.gif width=10 height=10 hspace=0 vspace=0 /></td>");
      	fnO("<td class=page>");
	
}	
function fnDoMenu(d,strRoot,strArea, asMenu, nBorder, strTitle)
{
	var strURL= document.location.href;
	var aParts=strURL.split("/");
	var strPage=aParts[aParts.length-1];

	fnO("<TABLE  width=\"100%\" cellpadding=0 cellspacing=0 border=0>");
	
	
	
	fnO("<TR height=20 valign=center class=\"menu\">");
	fnO("<TD width=16></TD>");
	for(i=0;i<g_aMenu.length;i++)
	{
		fnO("<TD align=\"left\"><B ><a HREF="+strRoot+"/"+g_aMenu[i].url+">"+g_aMenu[i].name+"</a></B></TD>");
	}
	fnO("<TD width=16></TD>");
	fnO("</TR>");
	fnO("<TR HEIGHT=1 bgcolor=#000000 VALIGN=top><TD COLSPAN="+(g_aMenu.length+2)+">");
	fnO("</TD></TR>");
	
	
	fnO("<TR HEIGHT=20 class=\"submenu\">");
	fnO("<TD width=16></TD>");
	fnO("<TD colspan="+g_aMenu.length+" align=\"left\">");
	fnO("<TABLE ><TR >");
	for(i=0;i<g_aMenu.length;i++)
	{
		bInMenu=false;
		if (g_aMenu[i].url!=null)
		{
			if (strArea!=null)
			{
				if(strArea==g_aMenu[i].url)
					bInMenu=true;
			}
			else
			{	
				if (strPage==g_aMenu[i].url)
				{
					bInMenu=true;
				}
			}
		}
		if(bInMenu)
		{ 
			fnO("<TD align=\"left\"><B><a HREF="+strRoot+"/"+g_aMenu[i].url+">"+g_aMenu[i].name+"</a></B></TD>");
			fnO("<TD width=16></TD>");
			aSubMenu=g_aMenu[i].submenu;
			if (aSubMenu!=null)
			{
				for(j=0;j<aSubMenu.length;j++)
				{
					fnO("<TD align=\"left\"><B ><a HREF="+strRoot+"/"+aSubMenu[j].url+">"+aSubMenu[j].name+"</a></B></TD>");
					fnO("<TD width=16></TD>");
				}
			}
		}
	}
	fnO("</TR></TABLE></TD>");
	fnO("<TD width=16></TD>");
	fnO("</TD></TR>");
	fnO("<TR HEIGHT=1 bgcolor=#000000 VALIGN=top><TD COLSPAN="+(g_aMenu.length+2)+">");
	fnO("</TD></TR>");

	if (asMenu!=null)
	{
		fnO("<TR HEIGHT=20  class=\"productmenu\" >");
		fnO("<TD width=16></TD>");
		fnO("<TD colspan="+g_aMenu.length+" align=\"left\">");
		fnO("<TABLE width=100%><TR>");
		for(i=0;i<asMenu.length/2;i++)
		{
			fnO("<TD align=center ><B  ><a HREF="+asMenu[i*2+1]+">"+asMenu[i*2]+"</a></B></TD>");
			fnO("<TD width=16></TD>");
		}
		fnO("</TR></TABLE></TD>");
		fnO("<TD width=16></TD>");
		fnO("</TD></TR>");	
	}

	fnO("<TR HEIGHT=1 bgcolor=#c0c0c0 VALIGN=top><TD COLSPAN="+(g_aMenu.length+2)+">");
	fnO("</TD></TR>");
	fnO("</TABLE>");
	
	if (nBorder)
	{
		fnO("<TABLE WIDTH=100% height=400 BORDER=0><TR><TD WIDTH="+nBorder+"></TD>");
		if(strTitle)
		{
			fnO("<TD HEIGHT=32 ALIGN=CENTER VALIGN=CENTER><B class=pagetitle>"+strTitle+"</B></TD><TD WIDTH="+nBorder+"></TD></TR>");
			fnO("<TR><TD WIDTH="+nBorder+"></TD><TD VALIGN=TOP align=left>");
		}
		else
			fnO("<TD VALIGN=TOP align=left>");
	}
	else
		fnO("<TABLE height=400 BORDER=0><TR><TD WIDTH=16></TD><TD align=left>");
		
}

function fnDoFooter(d,strRoot, nBorder)
{
	var strImageDir = strRoot+"/"+g_strImageDir+"/";

	if (nBorder)
		fnO("</TD><TD WIDTH="+nBorder+"></TD></TR>");
	else
		fnO("</TD><TD WIDTH=16></TD></TR>");
	fnO("<TR HEIGHT=32><TD COLSPAN=3></TD></TR></TABLE>");
	
	fnO("<TABLE class=copyright width=\"100%\" cellpadding=0 cellspacing=0 border=0>");
	fnO("<TR HEIGHT=1 bgcolor=#c0c0c0 VALIGN=top><TD COLSPAN="+(g_aMenu.length+2)+">");
	fnO("</TD></TR>");
	fnO("<TR HEIGHT=1 bgcolor=#000000 VALIGN=top><TD COLSPAN="+(g_aMenu.length+2)+">");
	fnO("</TD></TR>");
	fnO("<TR height=20 valign=center>");
	fnO("<TD width=16></TD>");
	fnO("<TD align=right>");
	fnO("<B >&copy; Copyright 2003 SoundFaction. All rights reserved</B>");
	fnO("</TD>");
	fnO("<TD width=16></TD>");
	fnO("<TD align=left>");
	fnO("<B ><A HREF="+strRoot+"/privacy.htm>Privacy Policy</A></B>");
	fnO("</TD>");
	
	fnO("<TD width=16></TD>");
	fnO("</TR>");
	
	fnO("</TABLE>");


      	fnO("</td>");
      	fnO("<td width=4 background="+strImageDir+"/shadr.gif><img src="+strImageDir+"/shadr.gif width=10 height=10 hspace=0 vspace=0 /></td>");
	fnO("</tr>");

	fnO("<tr>");
      	fnO("<td width=4><img src="+strImageDir+"/shadbl.gif width=10 height=10 hspace=0 vspace=0 /></td>");
	fnO("<td height=4 background=\""+strImageDir+"/shadb.gif\"><img src="+strImageDir+"/shadb.gif width=20 height=10 hspace=0 vspace=0 /></td>");
      	fnO("<td width=4><img src="+strImageDir+"/shadbr.gif width=10 height=10 hspace=0 vspace=0 /></td>");
    	fnO("</tr>");

	fnO("</TABLE>");
	fnO("</div>");
	
	fnO("</BODY>");
}


function fnDoProductList(d, strRoot, bPrices)
{
	
	fnO("<table valign=top width=100% ");
	if (bPrices!=null)
		fnO(" CELLSPACING=0 CELLPADDING=4 BORDER=0>");
	else
		fnO(" CELLSPACING=4 CELLPADDING=2 BORDER=0>");
	fnO("<tr>");
	for(i=0;i<g_aProducts.length;i++)
	{
		if(bPrices!=null)
		{
		fnO("<TD ALIGN=right><A HREF="+strRoot+"/"+g_aProducts[i].uid+"/pricing.htm><IMG    SRC="+g_aProducts[i].uid+"/images/logo.gif BORDER=0></A></TD><TD align=left><P class=\"producttitle\"><A HREF="+strRoot+"/"+g_aProducts[i].uid+"/pricing.htm>"+g_aProducts[i].name+"</A></P></TD>");
		
		}
		else	
		{
		nWidth=200;
		    fnO("<td ALIGN=center valign=top >");
		    fnO("<table valign=top width="+nWidth+" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
			    fnO("<tr><td width="+nWidth+" >");
			    fnO("<img src=\""+strRoot+"/"+g_strImageDir+"/productheader.gif\" width="+nWidth+"  hspace=\"0\" vspace=\"0\" border=\"0\" />");
			    fnO("</td></tr><tr><td>");

			   fnO("<table valign=top width="+nWidth+" height=\"150\" border=\"0\" cellspacing=\"0\" bgcolor=\"#336699\">");
			   fnO("<tr><td>");

				   fnO("<table  width="+(nWidth-2)+" valign=top border=\"0\" cellpadding=\"0\" cellspacing=\"0\">");
					   fnO("<tr><td valign=center  align=center class=productboxtitle><a href=\""+strRoot+"/"+g_aProducts[i].uid+"/index.htm\">");
					   fnO("<IMG width=60  align=center SRC="+g_aProducts[i].uid+"/images/logo.gif border=0>");
					   fnO("</A></td>");
					   fnO("<td  width="+(nWidth-60)+" align=left valign=\"center\" class=productboxtitle>");
					   fnO("<p class=\"productboxtitle\" >");
					   fnO("<a class=\"productboxtitle\" href=\""+strRoot+"/"+g_aProducts[i].uid+"/index.htm\">"+g_aProducts[i].name);
					   fnO("</a></p>");
					   //fnO("<IMG SRC=images/spacer.gif height=2 border=1 width="+(nWidth-60)+">");
					   fnO("</td></tr>");
					   fnO("<tr><td colspan=2 width="+nWidth+">");

						   fnO("<table width=100% bgcolor=\"#FFFFFF\" cellpadding=0 cellspacing=0 border=0>");
							   fnO("<tr><td bgcolor=\"#FFFFFF\" width=4><IMG SRC=images/spacer.gif width=4 height=0></td>");
							   fnO("<td  colspan=2 bgcolor=\"#FFFFFF\">");
							   fnO("<p class=boxtext><FONT COLOR=black SIZE=-2>"+g_aProducts[i].desc+"</p>");
							   fnO("<P class=boxtext><a href=\""+strRoot+"/"+g_aProducts[i].uid+"/index.htm\">More info</a>");
							   fnO("</td><td bgcolor=\"#FFFFFF\" width=4><IMG SRC=images/spacer.gif width=4 height=0>");
						   fnO("</td></tr><tr><td height=8 colspan=3></td></tr></table>");

				    fnO("</td></tr></table>");

			   fnO("</td></tr></table></td>");
		   fnO("</td></tr></table></td>");
		   
		}
			
	}
	fnO("</tr></table>");
}	

function fnDoFeatureHeading(d,strRoot, strFeature,strName)
{
	
	fnO("<TABLE WIDTH=100%>");
	fnO("<TR><TD COLSPAN=2><HR COLOR=#000000 SIZE=1></TD></TR>");
	
	fnO("<TR>");
	fnO("<TD><A NAME="+strName+"></A>");
	fnO("<FONT  class=featureheading><B>");
	fnO(strFeature);
	fnO("</B></FONT></TD>");
	fnO("<TD ALIGN=RIGHT><A HREF=#top><IMG BORDER=0 SRC="+strRoot+"/images/backtotop.gif></A></TD>");
	fnO("</TR></TABLE>");
}
