var tid1;
var tid2;
var tid3;
var overed = false;

function DropMenuProcess(obj)
{
    obj.className='itemmpover';
    clearTimeout(tid1);
    clearTimeout(tid2);
    var left=0;
    var id = obj.id;
    var top=obj.offsetHeight;
    do
    {
        left+=obj.offsetLeft;
        top+=obj.offsetTop;
        obj = obj.parentNode
    }
    while (obj.tagName != "BODY")
    left+=obj.offsetLeft;
    top+=obj.offsetTop;
    top=top/2+15;
    var oo = document.getElementById("dropmenucontent");
    if (oo!=null)
    {
        oo.style.display="none";
        oo.id="";
        oo.innerHTML="";
    }
    var o = document.createElement("div");
    o.id = "dropmenucontent";
    o.innerHTML="";
    o.style.display = "block";
    o.style.top = top + "px";
    o.style.left = left + "px";
    o.style.position = "absolute";
    o.style.width = "auto";
    o.onmouseover = function() {overed = true; clearTimeout(tid2); ficha(0.9, this);}
    o.onmouseout = function() {overed = false; Hide(0);}
    obj.appendChild(o);
    overed = true;
    switch (id)
    {
        case "audi" : 
            {
                addDiv(o, ["<a href='a4.html'><b>Audi A4</b></a>", "<a href='a6.html'><b>Audi A6</b></a>"], -1);
            } break;
        case "BMW" : 
            {
                addDiv(o, ["<a href='bmw7.html'><b>BMW 7</b></a>", "<a href='x5.html'><b>BMW X 5</b></a>"], -1);
            } break;

  	case "Chevrolet" : 
            {
                addDiv(o, ["<a href='aveo.html'><b>Chevrolet Aveo</b></a>", "<a href='lacetti.html'><b>Chevrolet Lacetti</b></a>", "<a href='lanos.html'><b>Chevrolet Lanos</b></a>" , "<a href='captiva.html'><b>Chevrolet Captiva</b></a>"], -1);
            } break;

  	case "Chery" : 
            {
                addDiv(o, ["<a href='tiggo.html'><b>Chery Tiggo</b></a>", "<a href='amulet.html'><b>Chery Amulet</b></a>"], -1);
            } break;

  	case "Citroen" : 
            {
                addDiv(o, ["<a href='c4.html'><b>Citroen C 4</b></a>", "<a href='c5.html'><b>Citroen C5</b></a>"], -1);
            } break;

	case "Fiat" : 
            {
                addDiv(o, ["<a href='albea.html'><b>Fiat Albea</b></a>", "<a href='linea.html'><b>Fiat Linea</b></a>"], -1);
            } break;

	case "Ford" : 
            {
                addDiv(o, ["<a href='focus.html'><b>Ford Focus 3</b></a>", "<a href='mondeo.html'><b>Ford Mondeo 3</b></a>", "<a href='fiesta.html'><b>Ford Fiesta</b></a>"], -1);
            } break;

	case "Hendey" : 
            {
                addDiv(o, ["<a href='getz.html'> <b>Hyundai Getz</b></a>", "<a href='solaris.html'><b>Hyundai Solaris</b></a>"], -1);
            } break;

	case "Honda" : 
            {
                addDiv(o, ["<a href='accord.html'><b>Honda Accord</b></a>", "<a href='civic.html'><b>Honda Civic</b></a>",  "<a href='civics.html'><b>Honda Civic 4D</b></a>",  "<a href='cr-v.html'><b>Honda CRV</b></a>"], -1);
            } break;

	case "Kia" : 
            {
                addDiv(o, ["<a href='ceed.html'><b>Cee`d </b></a>", "<a href='spectra.html'><b>Spectra</b></a>", "<a href='cerato.html'><b>Cerato</b></a>"], -1);
            } break;

	case "Lexus" : 
            {
                addDiv(o, ["&nbsp;"], -1);
            } break;

	case "Mercedes" : 
            {
                addDiv(o, ["&nbsp;"], -1);
            } break;

	case "Mazda" : 
            {
                addDiv(o, ["<a href='mazda3.html'><b>Mazda 3</b></a>", "<a href='mazda6.html'><b>Mazda 6</b></a>"], -1);
            } break;

	case "Mitsubishi" : 
            {
                addDiv(o, ["<a href='lancer10.html'><b> Lancer 10</b></a>"], -1);
            } break;

	case "Nissan" : 
            {
                addDiv(o, ["<a href='almera.html'><b> Almera Classic</b></a>", "<a href='note.html'><b>Note</b></a>", "<a href='qashqai.html'><b>Qashqai</b></a>"], -1);
            } break;

	case "Opel" : 
            {
                addDiv(o, ["<a href='vectra.html'><b>Opel Vectra C</b></a>"], -1);
            } break;

	case "Peugeot" : 
            {
                addDiv(o, ["<a href='206.html'><b>Peugeot 206</b></a>", "<a href='307.html'><b>Peugeot 307</b></a>", "<a href='308.html'><b>Peugeot 308</b></a>", "<a href='407.html'><b>Peugeot 407</b></a>"], -1);
            } break;

	case "Renault" : 
            {
                addDiv(o, ["<a href='logan.html'><b>Renault Logan</b></a>"], -1);
            } break;

	case "Seat" : 
            {
                addDiv(o, ["&nbsp;"], -1);
            } break;

	case "Skoda" : 
            {
                addDiv(o, ["&nbsp;"], -1);
            } break;


	case "Toyota" : 
            {
                addDiv(o, ["<a href='auris.html'><b>Toyota Auris</b></a>", "<a href='avensis.html'><b>Toyota Avensis</b></a>"], -1);
            } break;


	case "Volkswagen" : 
            {
                addDiv(o, ["<a href='jetta.html'><b>Volkswagen Jetta</b></a>"], -1);
            } break;


	case "Volvo" : 
            {
                addDiv(o, ["&nbsp;"], -1);
            } break;


	case "Geely" : 
            {
                addDiv(o, ["<a href='mk.html'><b>Geely MK</b></a>", "<a href='otaka.html'><b>Geely Otaka</b></a>"], -1);
            } break;
    }
}

function Hide(t)
{
    var o = document.getElementById("dropmenucontent");
    if (t==1 && !overed)
    {
        if (o!=null)
        {
            o.style.display="none";
            o.id="";
            o.innerHTML="";
        }
        overed=false;
    }
    if (t==0)
    {
        clearTimeout(tid3);
        if (o!=null)
        {antificha(1.4,o);}
        tid3 = setTimeout(function(){Hide(1);},900);
    }
}

function HideDropMenuProcess(obj)
{
    obj.className='itemmp';
    overed=false;
    Hide(0);
}

function aGetFnc(i, obj)
{
	return function() {antificha(i, obj);}
}

function GetFnc(i, obj)
{
	return function() {ficha(i, obj);}
}

function GetFnc1(o, text, i)
{
	return function() {addDiv(o, text, i);}
}

function addDiv (o, text, i)
{
  i++;
  if (i>=text.length) {return;}
  var n = document.createElement("div");
  n.innerHTML = text[i];
  n.className = "mainsubmenu";
  n.onmouseover = function() {this.className = "mainsubmenuover";};
  n.onmouseout = function() {this.className = "mainsubmenu";};
  o.appendChild(n);
  ficha(0,n);
  tid1 = setTimeout(GetFnc1(o, text, i),40);
}

function ficha(i, obj)
{
	i+=0.1;
    var val = parseInt(i*100);
	obj.style.filter = "alpha(opacity="+val+")";
	obj.style.opacity = i;
	if (i<0.8)
	{
		tid2 = setTimeout(GetFnc(i, obj),30);
	}
}

function antificha(i, obj)
{
	i-=0.1;
    var val = parseInt(i*100);
	obj.style.filter = "alpha(opacity="+val+")";
	obj.style.opacity = i;
	if (i>0)
	{
		tid2 = setTimeout(aGetFnc(i, obj),100);
	}
	else
	{
	    obj.id="";
	    obj.style.display = "none";
	    obj.innerHTML="";
	}
}




