﻿function Toggle(uid)
{
    var obj = document.getElementById(uid);
    if (obj != null) {
        if (obj.style.visibility == "hidden") {
            obj.style.visibility = "";
        }
        else {
            obj.style.visibility = "hidden";
        }
    }
}

function ResizeFrame()
{
    var obj;
    var divHeight;
    if (window.parent != null) {
        if (window.parent.fraDetail != null) {
//            obj = window.parent.fraDetail.document.getElementById("divDetail");
//            if (obj != null) {
//                divHeight = obj.offsetHeight;
//            }
//            obj = window.parent.document.getElementById("fraDetail");
//            if (obj != null) {
//                if (divHeight != null) obj.style.height = divHeight + "px";
//            }
//            obj = window.parent.document.getElementById("divGwbResult");
//            if (obj != null) {
//                if (divHeight != null) obj.style.height = divHeight + 200 + "px";
            //            }
            obj = window.parent.fraDetail.document.getElementById("divDetail");
            if (obj != null) {
                divHeight = obj.offsetHeight;
            }
            obj = window.parent.document.getElementById("fraDetail");
            if (obj != null) {
                if (divHeight != null) obj.style.height = divHeight + "px";
            }
            obj = window.parent.document.getElementById("divGwbResult");
            if (obj != null) {
                if (divHeight != null) obj.style.height = divHeight + "px";
            }
        }
    }
}

function ShowRenault() {
    alert('Renault');
}

function ShowNissan() {
    alert('Nissan');
}

function ShowDacia() {
    alert('Dacia');
}

function ShowGwb() {
    alert('Gwb');
}

var isActive = false;

function HideStartpageDetail() {
    var obj = document.getElementById('divStartPageDetail');
    if (obj != null) {
        obj.className = "divStartPageDetail hidden";
    }
    obj = document.getElementById('divRenaultDetail');
    if (obj != null) {
        obj.className = "divStartPageDetail hidden";
    }
    obj = document.getElementById('divNissanDetail');
    if (obj != null) {
        obj.className = "divStartPageDetail hidden";
    }
    obj = document.getElementById('divDaciaDetail');
    if (obj != null) {
        obj.className = "divStartPageDetail hidden";
    }
    obj = document.getElementById('divGwbDetail');
    if (obj != null) {
        obj.className = "divStartPageDetail hidden";
    }
}

function StartPageShow(name) {
    document.location.href += name;
}

function StartPageCompleted(name) {
}

var val = null;
var va1 = null;

function StartPageOver(name) {
    val1 = setTimeout("StartPageOverTimeout('" + name + "');", 2000);
}

function StartPageOverTimeout(name) {
    if (val != null) clearTimeout(val);
    //if (!isActive) {
    isActive = true;
    HideStartpageDetail();
    var obj = document.getElementById('div' + name + 'Detail');
    if (obj != null) {
        obj.className = "divStartPageDetail";
    }
    //}
}

function StartPageLeave() {
    if (val1 != null) clearTimeout(val1);

    val = setTimeout("StartPageLeaveTimeout();", 2000);
    isActive = false;
}

function StartPageLeaveTimeout() {
    HideStartpageDetail();
    var obj = document.getElementById('divStartPageDetail');
    if (obj != null) {
        obj.className = "divStartPageDetail";
    }
    
}
