﻿
/*

This file handles the functionality of the Menu, and also some functions to insert flash files.

*/

/// This variable is set on the page loading, it holds the current page without extension.
var curPage;

/// This function highlights the estimate link by changing the picture.
function HighlightEstimateLink()
{
 document.getElementById('EstimateDiv').className = 'EstimateLink EstimateLinkOver';
}

/// This function switches back the original estimate link.
function OriginalEstimateLink()
{
 document.getElementById('EstimateDiv').className = 'EstimateLink';
}    

// Uses the standard mode for Injecting internal flash videos.  Meant as a helper function.
function InjectFlash(fileName, containerName)
{
   fileName = "/flash/"+fileName+".swf";
   var so = new SWFObject(fileName, fileName+"1", "240", "216", "7", "#F1E6D9");
   so.addParam("quality", "high");   
   so.addParam("wmode", "opaque"); 
   so.write(containerName);
}

function InjectTagline()
{
   fileName = "/flash/OneStopShop2.swf";
   var so = new SWFObject(fileName, fileName+"1", "300", "72", "7");
   so.addParam("quality", "high");   
   so.addParam("wmode", "transparent"); 
   so.write('HeaderTaglineContainer');
}

function HideHeaderTagLine()
{
    document.getElementById('HeaderTaglineContainer').style.display = 'none';
}

function ShowHomeRollover()
{  
   var so = new SWFObject("/flash/iannelli_HomeVideo.swf", "rolloverFlash", "213", "150", "7", "#FFFFFF");
   so.addParam("quality", "high");
   so.useExpressInstall("/flash/expressinstall.swf");
   so.addParam("wmode", "opaque");   
   so.write("TonyVideoContainer");
   
   var so = new SWFObject("/flash/rainloop_4prod.swf", "rightFlash", "250", "190", "7", "#F1E6D9");
   so.addParam("quality", "high");   
   so.addParam("wmode", "opaque"); 
   so.addParam("salign", "LT");     
   so.addParam("loop", "true");
   so.write("HomeRightFlash");
   
   var so = new SWFObject("/flash/gtHomeMO2.swf", "rolloverFlash", "527", "248", "7", "#FFFFFF");
   so.addParam("quality", "high");
   so.useExpressInstall("/flash/expressinstall.swf");
   so.addParam("wmode", "opaque");   
   so.write("RolloverContainer");
}

function ShowColorSelectorFlash()
{
    var so = new SWFObject("/flash/colorpicker/164_colorpicker_09.swf", "colorSelector", "723", "390", "7", "#FFFFFF");
    so.addParam("quality", "high");
    so.addParam("wmode", "opaque");   
    so.write("ColorSelectorContainer");       
}

// Show the homepage right flash on delay with a grow effect.
function ShowHomeRightFlash()
{
    new Effect.Grow(document.getElementById('HomeRightFlash'), {duration: 1.2})
}