function AddProduct(cName, cID)
{
   location.href = '/' + cName + '?AddProduct=' + cID;    
}
/////////////////////////// functions called by HTML ///////////////////

// These functions represent the external interface to the HTML page.

function StartVideo()			{ main ? main.htmlStartVideo() 								: false; }
function StopVideo() 			{ main ? main.htmlStopVideo() 								: false; }
// function PlayVideo() 			{ main ? main.htmlPlayVideo() 								: false; }
// function PlayTrack(nIndex) 	    { main ? main.htmlPlayTrack(nIndex) 						: false; }
function StartGallery() 		{ main ? main.htmlStartGallery() 							: false; }
function PauseResumeSlideShow() { main ? main.htmlPauseResumeSlideShow()                    : false; }
function PrevSlide()			{ main ? main.htmlPrevSlide()								: false; }
function NextSlide()			{ main ? main.htmlNextSlide()								: false; }

// New 2008 Video Controls
function Mute() 									{main ? main.htmlMute() 						: false;}
function PlayPause() 								{main ? main.htmlPlayPause() 					: false;}
function PlayFlv(cFlv) 								{main ? main.htmlPlay(cFlv) 					: false;}
function StopFlv() 									{main ? main.htmlStop() 						: false;}
function Volume(nVol)	 							{main ? main.htmlVolume(nVol) 				: false;}
function HideReveal()		 						{main ? main.htmlHideReveal()	 		 	 	: false;}
// End 2008

// New 2008 Video Controls
function MuteTrack() 										{main ? main.htmlMuteAudio() 							: false;}
function PlayPauseTrack() 								{main ? main.htmlPlayPauseAudio() 					: false;}
function PlayTrack(nTrack) 						{main ? main.htmlPlayAudio(nTrack) 					: false;}
// function StopTrack() 								{main ? main.htmlStopAudio() 							: false;}
function VolumeTrack(nVol)	 							{main ? main.htmlVolumeAudio(nVol) 					: false;}
// End 2008


// Product 2008

function PlayVideo(cFlv) 			{ main ? main.htmlPlayVideo(cFlv) 						: false; }
function PlayTrack(nIndex) 	   { main ? main.htmlPlayAudio(nIndex) 					: false; }
function StartSlideShow() 	    	{ main ? main.htmlStartSlideShow() 						: false; }

// End Product 2008

// Showcase

function pauseResumeVideo() 		{ main ? main.htmlPauseResumeVideo() 					: false; }

// Showcase


/////////////////////////// end //////////////////////////////////


///////////////////////// main /////////////////////////////////

var main;
var ahtmlVars;

window.onload = function() {

	main = new mainControl();
	aHtmlVars = new Array();
	try { aHtmlVars.push(cMediaFolder); } 		catch(err) { aHtmlVars.push(""); } ;
	try { aHtmlVars.push(cImageFolder); } 		catch(err) { aHtmlVars.push(""); } ;
	try { aHtmlVars.push(cImageHolderID); } 	catch(err) { aHtmlVars.push(""); } ;
	try { aHtmlVars.push(aSoundTracks); } 		catch(err) { aHtmlVars.push([]); } ;
	try { aHtmlVars.push(nInitialTrack); } 	    catch(err) { aHtmlVars.push(""); } ;
	try { aHtmlVars.push(cVideoName); } 		catch(err) { aHtmlVars.push(""); } ;
	try { aHtmlVars.push(aImages); } 			catch(err) { aHtmlVars.push([]); } ;	
	try { aHtmlVars.push(aMontages); } 			catch(err) { aHtmlVars.push([]); } ;	
	try { aHtmlVars.push(cMontageHolderID); }   catch(err) { aHtmlVars.push(""); } ;
	try { aHtmlVars.push(cSectionName); }       catch(err) { aHtmlVars.push(""); } ;
	main.init("main", aHtmlVars);
	
	var cHeight1;
	var cHeight2;
	if ( typeof cSectionName == "undefined" )
	{
		cHeight1 = document.getElementById("divMainBody").offsetHeight + 700 + "px";
		cHeight2 = document.getElementById("divMainBody").offsetHeight + 692 + "px";
	}
	else
	{
		if ( cSectionName != null && cSectionName == "Portfolio" )
		{
			cHeight1 = document.getElementById("divPortfolioDesc").offsetHeight + 700 + "px";
			cHeight2 = document.getElementById("divPortfolioDesc").offsetHeight + 692 + "px";
		}
		else if ( cSectionName != null && cSectionName == "LandingPages" )
		{
		    cHeight1 = document.getElementById("divMainBody").offsetHeight + 714 + "px";
			cHeight2 = document.getElementById("divMainBody").offsetHeight + 706 + "px";
			//document.getElementById("divMainBody").style.top = "250px";
		}
	    else if ( cSectionName != null && cSectionName == "ViewQuote" )
		{
		    cHeight1 = document.getElementById("QuoteList").offsetHeight + 714 + "px";
			cHeight2 = document.getElementById("QuoteList").offsetHeight + 706 + "px";
			//document.getElementById("divMainBody").style.top = "250px";
		}
	    else if ( cSectionName != null && cSectionName == "News" )
		{
		    cHeight1 = document.getElementById("News").offsetHeight + 714 + "px";
			cHeight2 = document.getElementById("News").offsetHeight + 706 + "px";
			//document.getElementById("divMainBody").style.top = "250px";
		} 
		else if ( cSectionName != null && cSectionName == "Showcase2008" )
		{
		    cHeight1 = document.getElementById("Showcase").offsetHeight + 414 + "px";
			cHeight2 = document.getElementById("Showcase").offsetHeight + 406 + "px";
			//document.getElementById("divMainBody").style.top = "250px";
		}
		else if ( cSectionName != null && cSectionName == "Product2008" )
		{
		    cHeight1 = document.getElementById("divMainBody").offsetHeight + 700 + "px";
			cHeight2 = document.getElementById("divMainBody").offsetHeight + 692 + "px";
			//document.getElementById("divMainBody").style.top = "250px";
		}
		else
		{
			cHeight1 = document.getElementById("divMainBody").offsetHeight + 700 + "px";
			cHeight2 = document.getElementById("divMainBody").offsetHeight + 692 + "px";
		}
	}
	
	document.getElementById("divOuterLHS").style.height        = cHeight1;
	document.getElementById("divOuterRHS").style.height        = cHeight1;
	document.getElementById("divLHS").style.height             = cHeight1;
	document.getElementById("divRHS").style.height             = cHeight2;
	document.getElementById("divInnerRepeatArea").style.height = cHeight2;
	
	
}



