function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;

    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

//change the opacity for different browsers
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
} 

// Top Menu

function fnBuildTopMenu(cIn)
{
    var cTemp = "";

    cTemp = cTemp + "<table width='534' border='0' cellpadding='0' cellspacing='0'>";
    cTemp = cTemp + "<tr>";
    if (cIn == "Aboutus")
    {
        cTemp = cTemp + "<td width='107' align='center'><span style='color: #fff600;'><b>About Us</b></span></td>";
    }
    else
    {
        cTemp = cTemp + "<td width='107' align='center'><a href='aboutus.php' class='topLink'>About Us</a></td>";          
    }
    
    if (cIn == "Services")
    {
        cTemp = cTemp + "<td width='107' align='center'><span style='color: #fff600;'><b>Services</b></span></td>";
    }
    else
    {
        cTemp = cTemp + "<td width='107' align='center'><a href='services.php' class='topLink'>Services</a></td>";         
    }

    if (cIn == "Portfolio")
    {
        cTemp = cTemp + "<td width='107' align='center'><span style='color: #fff600;'><b>Portfolio</b></span></td>";
    }
    else
    {
        cTemp = cTemp + "<td width='107' align='center'><a href='portfolio.php' class='topLink'>Portfolio</a></td>";           
    }
    
    if (cIn == "Clients")
    {
        cTemp = cTemp + "<td width='107' align='center'><span style='color: #fff600;'><b>Clients</b></span></td>";
    }
    else
    {
        cTemp = cTemp + "<td width='107' align='center'><a href='clients.php' class='topLink'>Clients</a></td>";           
    }

    if (cIn == "ContactUs")
    {
        cTemp = cTemp + "<td width='107' align='center'><span style='color: #fff600;'><b>Contact Us</b></span></td>";
    }
    else
    {
        cTemp = cTemp + "<td width='107' align='center'><a href='contactus.php' class='topLink'>Contact Us</a></td>";         
    }
    cTemp = cTemp + "</tr>";
    cTemp = cTemp + "</table>";

    document.write(cTemp);
}

// Bottom Menu

function fnBuildBotMenu(cIn)
{
    var cTemp = "";

    cTemp = cTemp + "<a class='botLink' href='index.php'>Home</a>&nbsp; <span style='color:#e8710d;'>|</span>&nbsp;";
    cTemp = cTemp + "&nbsp;<a class='botLink' href='aboutus.php'>About Us</a>&nbsp; <span style='color:#e8710d;'>|</span>&nbsp;";
    cTemp = cTemp + "&nbsp;<a class='botLink' href='services.php'>Services</a>&nbsp; <span style='color:#e8710d;'>|</span>&nbsp;";
    cTemp = cTemp + "&nbsp;<a class='botLink' href='portfolio.php'>Portfolio</a>&nbsp; <span style='color:#e8710d;'>|</span>&nbsp;";
    cTemp = cTemp + "&nbsp;<a class='botLink' href='clients.php'>Clients</a>&nbsp; <span style='color:#e8710d;'>|</span>&nbsp;";
    cTemp = cTemp + "&nbsp;<a class='botLink' href='products.php'>Products</a>&nbsp; <span style='color:#e8710d;'>|</span>&nbsp;";
    cTemp = cTemp + "&nbsp;<a class='botLink' href='contactus.php'>Contact Us</a>";

    document.write(cTemp);
}

