/*
This script all functions used on this site. 
Some are used for list writing, which means they open arrays and document write the array contents as a list, usually a menu.
Some are used to open new windows.
Who knows what else they may do.....????
*/


function howdeep()
{
var ThisURL = document.location.pathname    																														//sets ThisURL equal to the URL of the current page
var ThisURLarray= ThisURL.split("/")							                       //Page up until the number,html
var arrayLength = ThisURLarray.length                                                             //This will be two greater that expected, one for the 0 start in array, one for double slash
var myhost = location.host

/*if (myhost == "localhost")
{
		var howdeep = arrayLength - 6
}
else
{
		var howdeep = arrayLength - 2
}	
var getup = ""

for (i= 0; i < howdeep ; i++)
{
getup = getup + "../";
}*/
}


function banner()
{
var ThisURL = document.location.pathname    																														//sets ThisURL equal to the URL of the current page
var ThisURLarray= ThisURL.split("/")											     //Page up until the number,html
var arrayLength = ThisURLarray.length                                        //This will be two greater that expected, one for the 0 start in array, one for double slash
if (location.host == "localhost")
{
		var howdeep = arrayLength - 6
}
else
{
		var howdeep = arrayLength - 2
}	
var getup = ""

for (i= 0; i < howdeep ; i++)
{
getup = getup + "../";
}
var dirdepth = getup + "graphics"
document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="#3399ff" align="center">')
document.write('<tbody class="banner">')
document.write('<tr>')
document.write('    <td align="left" valign="top" width="22"><img src= " ' + dirdepth + '/roundlefttop.gif" alt="" width="22" height="22"></td>')
document.write('    <td align="center" valign="bottom"><br></td>')
document.write('     <td valign="top" width="22" align="right" nowrap="nowrap"><img src=" ' + dirdepth + '/roundrighttop.gif" alt="" width="22" height="22"></td>')
document.write('</tr>')
document.write('<tr>')
document.write('      <td valign="top"><br></td>')
document.write('      <td valign="top" align="center"><img src=" ' + dirdepth + '/transparent_sonix_logo.gif" alt="logo" height="120" width="382" border="0"></td>')
document.write('      <td valign="top"><br></td>')
document.write('</tr>')
document.write('<tr >')
document.write('       <td ></td>')
document.write('       <td align="center"> <h3>Professional Sound System Design, Sales and Service Since 1977<br></h3> &copy 2003</td>')
document.write('       <td ></td>')
document.write('</tr>')
document.write('<tr >')
document.write('       <td ></td>')
document.write('       <td ></td>')
document.write('       <td align="right"><img src=" ' + dirdepth + '/roundrightbottom.gif" height="22" width="22"></td>')
document.write('</tr>')
document.write('</tbody>')                        
document.write('</table>')
document.write('<table bgcolor="#3399FF" border="0" cellpadding="0" cellspacing="0" width="172">') 
document.write('<tbody>')
document.write('<tr>')
document.write('      <td valign="top" align="right">&nbsp; <br></td>')
document.write('      <td valign="top" width="22"><img src=" ' + dirdepth + '/roundleftinv.gif" width="22" height="22"></td>')
document.write('</tr>')
document.write('</tbody>') 
document.write('</table>')
}


/*
The following function takes listname as one of the above arrays. It is called from within various  floating div containers on such pages as links, .....
*/
function write_list_for(listname,whichclass)
{
var ThisURL = document.location.pathname    																														//sets ThisURL equal to the URL of the current page
var ThisURLarray= ThisURL.split("/")																			                       //Page up until the number,html
var arrayLength = ThisURLarray.length                                                             //This will be two greater that expected, one for the 0 start in array, one for double slash
if (location.host == "localhost")
{
		var howdeep = arrayLength - 6
}
else
{
		var howdeep = arrayLength - 2
}	
var getup = ""

for (i= 0; i < howdeep ; i++)
{
getup = getup + "../";
}
counter= 1
do  
{ 
   document.write('<a class = "' + whichclass + '" href = "   '  + getup +listname[counter] + ' ">'); 
   ++counter 
   document.write(listname [counter]+' </a><br>'); 
   ++counter 
} 
while(counter < listname.length )
}

function footer()
{
var ThisURL = document.location.pathname 			//sets ThisURL equal to the URL of the current page
var ThisURLarray= ThisURL.split("/")		                   //Page up until the number,html
var arrayLength = ThisURLarray.length                       //This will be two greater that expected, one for the 0 start in array, one for double slash

if (location.host == "localhost")
{
		var howdeep = arrayLength - 6
}
else
{
		var howdeep = arrayLength - 2
}	
var getup = ""

for (i= 0; i < howdeep ; i++)
{
getup = getup + "../";
}
var dirdepth = getup + "graphics"
document.write('Phone Number: 1-413-665-8800 &nbsp; &nbsp;&nbsp;E-mail to <a href="mailto:info@sonixproaudio.com">info@sonixproaudio.com</a><p>  <a href="http://www.visa.com"><img src=" ' + dirdepth + '/visa103x65.gif" width="103" height="65" border="0" alt="Visa Logo"></a>  <a href="http://www.mastercard.com"><img src=" ' + dirdepth + '/mc100.gif" width="102" height="61" border="0" alt="Master Card Logo"></a>  <a href="http://www.discovercard.com"><img src=" ' + dirdepth + '/dnovus45.gif" width="103" height="65" border="0" alt="Discover Plus logo"></a> </p>')
}

/*
following only used once at moment, so on that page (calendar) instead of here
function newWindow(windowURL, window_name, window_features)//where URL could be a file name.
{
thisnewwindow = window.open(windowURL, window_name,  window_features)
}
 */

