
var curImage= 0;
var imagesArray = new Array("","");
var imagecount = imagesArray.length;
var EnterpriseURLtxt = new Array('Enterprise Software Solutions','Enterprise Web Hosting');
var EnterpriseURL = new Array('http://www.tugboatenterprises.com/products/selkie_enterprise.aspx','http://www.tugboatenterprises.com/products/hosting.aspx');
var EBuyLinks = new Array('http://mailto:info@myselkie.com','http://www.tugboatenterprises.com/products/hosting.aspx');
var ETryLinks = new Array('','');
var BusinessURLtxt = new Array('Selkie Freedom Office','Selkie Rescue','Selkie IT','Selkie QFT', 'Business Web Hosting');
var BusinessURL = new Array('http://www.selkiefreedom.com','http://www.selkierescue.com','http://www.selkieit.com','http://www.selkieqft.com','http://www.tugboatenterprises.com/products/hosting.aspx');
var BBuyLinks = new Array('http://selkiefreedom.com/purchase.aspx#FreedomOffice','http://selkierescue.com/purchase.aspx','http://www.selkieit.com/it/purchase.aspx','https://www.regnow.com/softsell/nph-softsell.cgi?item=13521-4');
var BTryLinks = new Array('','http://shopat.myselkie.com/demos/SR/', 'http://www.tugent.com/SelkieITDemo.exe','http://www.tugent.com/SQFTDEMO.exe');
var HomeURLtxt = new Array('Selkie Freedom','Selkie Rescue','Selkie Music Mover', 'Selkie Photo Recovery', 'Selkie Email Recovery','Selkie QFT', 'Personal/Home Office Hosting');
var HomeURL = new Array('http://www.selkiefreedom.com','http://www.selkierescue.com','http://www.selkiemusic.com','http://www.selkiephoto.com','http://www.selkieemail.com','http://www.selkieqft.com', 'http://www.tugboatenterprises.com/products/hosting.aspx');
var HBuyLinks = new Array('http://selkiefreedom.com/purchase.aspx','https://www.cleverbridge.com/362/?scope=checkout&cart=32911&continueurl=http%3a%2f%2fwww.selkiemusic.com','https://www.cleverbridge.com/362/?scope=checkout&cart=33084','https://www.cleverbridge.com/362/?scope=checkout&cart=32910','https://www.regnow.com/softsell/nph-softsell.cgi?item=13521-4');
var HTryLinks = new Array('','http://www.tugent.com/SelkieMusicDemo.exe','http://www.tugent.com/SelkiePhotoDemo.exe','http://www.tugent.com/SelkieEmailDemo.exe','http://www.tugent.com/SQFTDEMO.exe');
var e;
var commandString;
var TBcommandString;
var PLcommandString;
var headerNamePass;

function slideshow()
{
if (document.images)
{
 curImage++;
 if (curImage == imagecount)
 {
 curImage = 0;
 }
 document.images["slideshowimage"].src = imagesArray[curImage];
 document.links["slideshowurl"].href = URLArray[curImage];
 setTimeout("slideshow()", 5000);   // 5000 = time in milliseconds
 }
 }
function removeWhitespace(xml)
{
	var loopIndex;
	
	for(loopIndex = 0; loopIndex < xml.childNodes.length; loopIndex++)
	{
		var currentNode = xml.childNodes[loopIndex];
		if(currentNode.nodeType ==1){
			removeWhitespace(currentNode);
		}
		
		if(((/^\s+$/.test(currentNode.nodeValue))) && 
			(currentNode.nodeType ==3)){
				xml.removeChild(xml.childNodes[loopIndex--]);
			}
	}
}

function ProductListings(heading)
{
	
try //Internet Explorer
  {
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  }
catch(e)
  {
  try //Firefox, Mozilla, Opera, etc.
    {
    xmlDoc=document.implementation.createDocument("","",null);
    }
  catch(e) {alert(e.message)}
  }
try 
  {
  xmlDoc.async=false;
  xmlDoc.load("../scripts/trialEnvironment.xml");
  removeWhitespace(xmlDoc);
  }
catch(e) {alert(e.message)}

	PLcommandString =""
	var x = xmlDoc.documentElement

	var categories = x.childNodes
		
	for(var i = 0; i < categories.length; i++)
	{
	if (categories[i].getAttribute('id')==heading)
	{
		
		var product = categories[i].childNodes
		for(var j = 0; j < product.length; j++)
		{
		
		var description = product[j].childNodes[4].textContent
		if(description == null)
		{
			description = product[j].childNodes[4].text
		}

			
		PLcommandString = PLcommandString + description + "<br />"
		}
	}
	}
	if (document.getElementById('ShortDescription') != null){
	document.getElementById('ShortDescription').innerHTML= PLcommandString}
	
	
}



function MouseOverHeaders(headerName)
{			
	
		var listCounter=0;
		var listIteration=0;
		headerNamePass=headerName;
		//write URLS with info to the SubTitle portion of header was CorpSubTitle
		e=document.getElementById('CorpSubMenuArea');
		switch(headerName){
			case 'Enterprise':
document.getElementById('CorpSubTitle').innerHTML = "Selkie Software";
			commandString="";
			
			for (var curIndex=0; curIndex < EnterpriseURLtxt.length; curIndex++)
			{
				if(listCounter == 0)
				{
					if (listIteration == 0)
					{
					commandString=commandString+'<div id="CorpSubMenuColumn" align="left" class="FloatLeft"><ul>';
					}
					else
					{
					listIteration = 0;
					commandString=commandString+'<div id="CorpSubMenuColumn" align="left" class="FloatRight"><ul>';
					}

				}
				listCounter++;
				commandString=commandString+'<li>';
				commandString=commandString+'<a onmouseover="ProductListings(\''+headerNamePass+'\')" href="'+EnterpriseURL[curIndex]+'">'+EnterpriseURLtxt[curIndex]+'</a>'+'&nbsp;&nbsp;';
				
				commandString=commandString+'</li>';

						if(listCounter==4)
						{
						listCounter=0;
						listIteration = 1;
						commandString=commandString+'</ul></div>';
						}
					
				
					

				
			}
			if (listCounter!=4)
			{
				commandString = commandString+'</ul></div>';
			}
			e.innerHTML = commandString;
			
			break;
			case 'Business':
document.getElementById('CorpSubTitle').innerHTML = "Selkie Software";
			commandString="";
			
			for (var curIndex=0; curIndex < BusinessURLtxt.length; curIndex++)
			{
				if(listCounter == 0)
				{
					if (listIteration == 0)
					{
					commandString=commandString+'<div id="CorpSubMenuColumn" align="left" class="FloatLeft"><ul>';
					}
					else
					{
					listIteration = 0;
					commandString=commandString+'<div id="CorpSubMenuColumn" align="left" class="FloatRight"><ul>';
					}

				}
				listCounter++;
				commandString=commandString+'<li>';
				commandString=commandString+'<a onmouseover="ProductListings(\''+headerNamePass+'\')" href="'+BusinessURL[curIndex]+'">'+BusinessURLtxt[curIndex]+'</a>'+'&nbsp;&nbsp;';
				
				commandString=commandString+'</li>';

						if(listCounter==4)
						{
						listCounter=0;
						listIteration=1;
						commandString=commandString+'</ul></div>';
						}
					
				
					

				
			}
			if (listCounter!=4)
			{
				commandString = commandString+'</ul></div>';
			}
			e.innerHTML = commandString;
			
			break;
			case 'Home':
document.getElementById('CorpSubTitle').innerHTML = "Selkie Software";
			commandString="";
			
			for (var curIndex=0; curIndex < HomeURLtxt.length; curIndex++)
			{
				if(listCounter == 0)
				{
					if (listIteration == 0)
					{
					commandString=commandString+'<div id="CorpSubMenuColumn" align="left" class="FloatLeft"><ul>';
					}
					else
					{
					listIteration = 0;
					commandString=commandString+'<div id="CorpSubMenuColumn" align="left" class="FloatRight"><ul>';
					}

				}
				listCounter++;
				commandString=commandString+'<li>';
				commandString=commandString+'<a onmouseover="ProductListings(\''+headerNamePass+'\')" href="'+HomeURL[curIndex]+'">'+HomeURLtxt[curIndex]+'</a>'+'&nbsp;&nbsp;';
				
				commandString=commandString+'</li>';

						if(listCounter==4)
						{
						listCounter=0;
						listIteration=1;
						commandString=commandString+'</ul></div>';
						}
					
				
					

				
			}
			if (listCounter!=4)
			{
				commandString = commandString+'</ul></div>';
			}
			e.innerHTML = commandString;
			
			break;
			case 'Partners':
				document.getElementById('CorpSubTitle').innerHTML = "Partnerships";
				document.getElementById('CorpSubMenuArea').innerHTML = "";
			break;
			case 'Corporate':
				document.getElementById('CorpSubTitle').innerHTML = "Company Profile";
				document.getElementById('CorpSubMenuArea').innerHTML = '<div id="CorpSubMenuColumn" class="FloatRight"><ul><li><a href="http://www.tugboatenterprises.com/info/contact.aspx">Contact</a></li><li><a href="http://www.tugboatenterprises.com/media/newsRelease/index.aspx">News Releases</a></li><li><a href="http://tugboatenterprises.com/info/whitepapers.aspx">Product White Papers</li></ul></div><div id="CorpSubMenuColumn" class="FloatRight"><ul><li><a href="http://www.tugboatenterprises.com/info/about.aspx">About Tugboat</a></li><li><a href="http://www.tugboatenterprises.com/info/legal.aspx">Legal</a></li><li><a href="http://www.tugboatenterprises.com/privacy.aspx">Privacy</a></li><li></li></ul></div>'
			break;
			
			default:
				
			break;
		}
		
		
	}
	
