﻿function flash() {
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='605' height='384'>")
    document.write("<param name='movie' value='flash.swf'>")
    document.write("<param name='quality' value='high'>")
    document.write("<param name='menu' value='false'>")
    document.write("<param name='wmode' value='transparent'>")
    document.write("<embed src='flash.swf' width='605' height='384' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' menu='false' wmode='transparent'></embed>")
    document.write("</object>");
}

function switchMovie(type,bodyStyle,year) {
    var strRequestUrl = document.URL;
    //var strRequestUrl = "http://ford-escape.model.tkcarsites.com/";
    var strURLParts = strRequestUrl.split("//");
    var strDomain = strURLParts[1].split(".model");
    var strMakeModel = strDomain[0].split("-");
    
    var make = strMakeModel[0];
    var model = strMakeModel[1];
    var variable ="../ImagesHandler.ashx?Params="+ type +"," + make +","+ model + "," + bodyStyle + "," + year;
    
    if(type == 'Exterior' || type == 'Interior')
    {
        document.getElementById('flash_console').innerHTML =  
        "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='400' height='275'>"
        +"<param name='movie' value='../scrolling.swf?handler="+variable + "'>"
        +"<param name='quality' value='high'>"
        +"<param name='menu' value='false'>"
        +"<param name='align' value='top'>"
        +"<param name='wmode' value='transparent'>"
        +"<embed src='../scrolling.swf?handler=" + variable + "'"
        +"width='400' height='275' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' menu='false' wmode='transparent'>"
        +"</embed></object>";
    }
    else if(type == 'Color')
    {
          document.getElementById('flash_console').innerHTML =  
            "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='400' height='249'>"
            +"<param name='movie' value='../colors.swf?handler="+variable + "'>"
            +"<param name='quality' value='high'>"
            +"<param name='menu' value='false'>"
            +"<param name='align' value='top'>"
            +"<param name='wmode' value='transparent'>"
            +"<embed src='../colors.swf?handler=" + variable + "'"
            +"width='400' height='249' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' menu='false' wmode='transparent'>"
            +"</embed></object>";
    }
     hideshowvideo(0,0);
}

function GetSpecial(siteId,dealerId,year)
{
    var strRequestUrl = document.URL;
    //var strRequestUrl = "http://acura-tl.model.tkcarsites.com/";
    var strURLParts = strRequestUrl.split("//");
    var strDomain = strURLParts[1].split(".model");
    var strMakeModel = strDomain[0].split("-");
    
    var make = strMakeModel[0];
    var model = strMakeModel[1];
      
    var variable ="../SpecialsHandler.ashx?Params="+ make +","+ model + "," + siteId + "," + dealerId + "," + year;
    
     document.getElementById('flash_special').innerHTML =  
    "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='389' height='116'>"
    +"<param name='movie' value='../specials_fn.swf?handler="+variable + "'>"
    +"<param name='quality' value='high'>"
    +"<param name='menu' value='false'>"
    +"<param name='wmode' value='transparent'>"
    +"<param name='allowScriptAccess' value='always'/>"
    +"<embed src='../specials_fn.swf?handler=" + variable + "'"
    +"width='389' height='116' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' menu='false' wmode='transparent'>"
    +"</embed></object>";
}

function hideshowvideo(status,videoId)
{
    if(status==0)
    {
        document.getElementById('flash_console').style.display = 'block';
        if(document.getElementById("vedio") != null)
        {
            document.getElementById("vedio").style.display = 'none';
            document.getElementById("videoifrm").src="";
        }
    }
    else
    {
        document.getElementById('flash_console').style.display = 'none'
        document.getElementById("vedio").style.display = 'block'; 
        
        if(videoId == null || videoId == "-999" || videoId == "")
        {
                document.getElementById("videoifrm").src= "../Images/Video_notAvailable.jpg";
        }
        else
        {
            document.getElementById("videoifrm").src="http://automotiontv.com/flash/automotion_player_lite.swf?id=4573&asset_id=" + videoId + "&code=871189031&playermode=get_display_data_lite&dn=http://automotiontv.com";
        }
    }
}


function DisplayMoreInfo()
{
    var divMoreInfo = document.getElementById('wel');
    var linkMoreInfo = document.getElementById("lnkMoreInformation");
    if(divMoreInfo.style.display == 'none') 
    {
        divMoreInfo.style.display = '';
        linkMoreInfo.innerText = "Close";
    }
    else
    {
       divMoreInfo.style.display = 'none' 
       linkMoreInfo.innerText = "More Information";
    }
}
function ShowThankYouMessage(btnSubmit)
{
    Page_ClientValidate();
    if(Page_IsValid)
    {
          btnSubmit.style.display = 'none';
          return true;
    }
}
