function get_link() 
{    
    var text_string = document.getElementById("lblQuotes").lastChild.data;
    alert(text_string);
}

//////////ADDED NEW FUNCTION
function Popup(url, windowname) {
    var w = 510;
    var h = 700;
    var x = parseInt((screen.availWidth / 2) - (w / 2));
    var y = parseInt((screen.availHeight / 2) - (h / 2));
    if (url.length == 0)
        url = "http://www.tdsm.com/html_docs/under_construction.htm";
    var window_attributes = "directories=no,resizable=no,toolbar=no,location=no,scrollbars=yes,menubar=no,status=no,directories=no,width=" + w + ",height=" + h + ",left=" + x + ",top=" + y + "";
    if (url.toUpperCase().indexOf(".PDF") != -1)
        window_attributes = "directories=no,resizable=yes,toolbar=no,location=no,scrollbars=yes,menubar=no,status=no,directories=no,width=" + w + ",height=" + h + ",left=" + x + ",top=" + y + "";
    window.open(url, windowname, window_attributes);
}

//We no longer need this function as the links are now going to content pages and not a frame control. (Paul)
/////////////////////changed function pop()
//function Pop(page) {
//    var newpage = "";
//    switch (page) {
//        case "mainLogin":
//            newpage = "aspx_docs/mainLogin.aspx?Page=main_home.aspx";
//            break;
//        case "Fleet_Maintenance":
//            newpage = "html_docs/Fleet_Maintenance.htm";
//            break;
//        case "driver_log_scan":
//            newpage = "html_docs/driver_log_scan.htm";
//            break;
//        case "Driver_Qualification":
//            newpage = "html_docs/Driver_Qualification.htm";
//            break;
//        case "Solutions":
//            newpage = "html_docs/Solutions.htm";
//            break;
//        case "E-Log":
//            newpage = "aspx_docs/Fast_Logs.aspx";
//            break;
//        case "EOBR_E_LOG":
//            newpage = "html_docs/electronic_logs.htm";
//            break;
//        default:
//            newpage = "html_docs/under_construction.htm";
//            break;
//    }
//    parent.document.getElementById('contentFrame').src = newpage;
//} 

//This function has been replaced by the switch statement above. (Paul)
//function Pop(page) 
//{
//    if (page == 'mainLogin')
//        //"../aspx_docs/mainLogin.aspx?Page=../aspx_DOCS/main_home.aspx"
//        parent.document.getElementById('contentFrame').src = "aspx_docs/mainLogin.aspx?Page=main_home.aspx";
//    if (page == 'Fleet_Maintenance')
//        parent.document.getElementById('contentFrame').src = "html_docs/Fleet_Maintenance.htm";
//    if (page == 'driver_log_scan')
//        parent.document.getElementById('contentFrame').src = "html_docs/driver_log_scan.htm";
//    if (page == 'Driver_Qualification')
//        parent.document.getElementById('contentFrame').src = "html_docs/Driver_Qualification.htm";
//    if (page == 'Solutions')
//        parent.document.getElementById('contentFrame').src = "html_docs/Solutions.htm";
//    if (page == 'E-Log')
//        parent.document.getElementById('contentFrame').src = "html_docs/electronic_logs.htm";
//        
//        parent.document.getElementById('contentFrame').src = "aspx_docs/Fast_Logs.aspx";
//    if (page == 'EOBR_E_LOG')
//        parent.document.getElementById('contentFrame').src = "html_docs/electronic_logs.htm";
//}

/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png");

overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png","button5over.png");

//*** NO MORE SETTINGS BEYOND THIS POINT ***//
totalButtons = upSources.length;

//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
//function PanelClick(vControl) {
//    __doPostBack(vControl, 'Click');
//}

//function preload() 
//{
//    for (x = 0; x < totalButtons; x++) 
//    {
//		buttonUp = new Image();
//		buttonUp.src = buttonFolder + upSources[x];
//		buttonOver = new Image();
//		buttonOver.src = buttonFolder + overSources[x];
//	}
//}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) 
{
	document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) 
{
	document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}

function setImg(But, img) 
{
	document.getElementById(But).src = img;
}

function showContent(val) 
{
    document.all.contentFrame.src=val;
    document.all.contentFrame.style.visibility="visible";
}

function Button1_onclick() 
{
    var v = "html_docs/home.htm";
    showContent(v);
}

function openNewWindow(address)
{
    window.open(address);
}

function showDemoDesc(htmldoc) {
    if (document.getElementById('ctl00$MainContent$descFrame') != null)
        document.getElementById('ctl00$MainContent$descFrame').value = htmldoc;
}

function hideDemoDesc(htmldoc) {
  if (document.getElementById('descFrame') != null)
    document.getElementById('descFrame').src = "../html_docs/blank.htm";
}

function showDescPanel(panel) {
    if (document.getElementById(panel) != null)
        document.getElementById(panel).style.visibility = 'visible';
}

function hideDescPanel(panel) {
    if (document.getElementById(panel) != null)
        document.getElementById(panel).style.visibility = 'hidden';
}

function resizeFrame() {
    if (document.getElementById('the_iFrame') != null) {
        var the_height = document.getElementById('the_iframe').contentWindow.document.body.scrollHeight;
        //change the height of the iframe
        document.getElementById('the_iframe').height = the_height;
    }
}

function UpdateLogin(strLogin) {
    parent.document.getElementById('lblcompanyname').innerText = strLogin;
    parent.document.getElementById('lbLoginID').innerHTML = "";
    parent.document.getElementById('lbLogoutID').innerHTML = "Log-Out";
}

function UpdateLogOut(strLogout){
    parent.document.getElementById('lblcompanyname').innerHTML = strLogout;
    parent.document.getElementById('lbLoginID').innerHTML = "Login";
    parent.document.getElementById('lbLogoutID').innerHTML = "";
}

function UpdateHeaderFlash(strQuote)
{ 
    /////////////////////////////creates new page to load in header flash area
    var content = "";
    content='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
    content+='<html xmlns="http://www.w3.org/1999/xhtml" >';
    content+='<html><head><link href="css/menustyle.css" rel="stylesheet" type="text/css" />'
    content += '</head><body class="contentArea" style="background-color:#677c97; height:100%;"><center><p class="headerText2">' + strQuote + '</p></center></body></html>';
    var iframe = document.getElementById('headerFrame');
    var doc = iframe.document;
    if(iframe.contentDocument)
        doc = iframe.contentDocument; // For mozilla
    else if(iframe.contentWindow)
        doc = iframe.contentWindow.document; // For IE
    doc.open();
    doc.writeln(content);
    doc.close();
}

function getFlashHeader()
{
    //debugger;
    if(navigator.appName == "Microsoft Internet Explorer")
    {
        var content = "";
        content += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="155px" id="FlashID">';
        content += '<param name="movie" value="header.swf" />';
        content += '<param name="quality" value="high" />';
        content += '<param name="wmode" value="transparent" />';
        content += '<param name="swfversion" value="6.0.65.0" />';    
        content += '<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt.-->';       
        content += '<!--<param name="expressinstall" value="expressInstall.swf" />-->';
        content += '<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->';
        content += '</object>';
        document.write(content);
    }
    else
    {
        var content = "";
        content += '<object type="application/x-shockwave-flash" data="header.swf" width="100%" height="155px">';
        content += '<param name="quality" value="high" />';
        content += '<param name="wmode" value="transparent" />';
        content += '<param name="swfversion" value="6.0.65.0" />';
        content += '<!--<param name="expressinstall" value="../Scripts/expressInstall.swf" />-->';
        content += '<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->';
        content += '<div>';
        content += '<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>';   
        content += '<p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>';    
        content += '</div>';
        content += '</object>';
        document.write(content);
    }
}
var oldgridSelectedColor;
var oldgridtextcolor;
function setMouseOverColor(element) {
    oldgridSelectedColor = element.style.backgroundColor;
    oldgridtextcolor = element.style.color;
    element.style.backgroundColor = 'ff2040';
    element.style.cursor = 'hand';
    element.style.textDecoration = 'underline';
    element.style.color = 'black';
}

function setMouseOutColor(element) {
    element.style.backgroundColor = oldgridSelectedColor;
    element.style.color = oldgridtextcolor;
    element.style.textDecoration = 'none';
}
//preload();
