var timeout = 0;

window .onload = init ;

function init()
{
	var menu = document .getElementById( 'menu' ) ;
 	if ( menu != null )
	{
		show_menu( menu ) ;
	}
}

function findPosX(obj)
{
	var curleft = 0 ;
	if( obj .offsetParent )
	{
		while( 1 )
		{   
			curleft += obj .offsetLeft ;
			if( ! obj .offsetParent )
			{
				break ;
			}

			obj = obj .offsetParent ;
		}
	}
	else if( obj .x )
	{
		curleft += obj .x ;
	}

	return curleft ;
}

function findPosY( obj )
{
	var curtop = 0;
	if( obj.offsetParent )
	{ 
		while( 1 )
		{
			curtop += obj.offsetTop;
			if( !obj.offsetParent )
			{
				break;
			}
			obj = obj.offsetParent;
		}
	}
	else if( obj.y )
	{
		curtop += obj.y;
	}
	return curtop;
}

function show_div( main_menu_element, submenu )
	{
		timeout = 0;
		var div = document .getElementById( submenu) ;
		div .style .top = findPosY( main_menu_element ) + 0 + 'px' ;
		div .style .left = findPosX( main_menu_element ) + 0 + 'px' ;
		div .style .visibility = 'visible' ;
	}       

function keep_div( main_menu_element, submenu )
	{
	if ( submenu == current_menu )
		{
			clearTimeout( timeout ) ;
		}
	else
		{
			current_menu = submenu ;
		}
	}

var timeout ;
var current_menu = '' ;

function hide_div(main_menu_element, submenu )
{
	timeout = setTimeout( function()
				{
					var div = document .getElementById( submenu ) ;
					div .style .visibility = 'hidden' ;
				}, 1 ) ;
}


function show_menu( menu )
{
        var div_menu = document .createElement( 'div' ) ;
        div_menu .id = 'menu' ;
        div_menu .className = 'menu' ;
        menu .appendChild( div_menu ) ;

        var table = document .createElement( 'table' ) ;
        table .style .marginTop = '12px' ;
        table .style .color = '#000000' ;
        table .style .fontFamily = 'verdana' ;
        table .style .fontSize = '12px' ;
	table .style .letterSpacing = '-1px' ;
	table .style .fontWeight = 'bold' ;
	table .style .padding = '0px' ;
	table .style . borderSpacing = '0px' ;
	
        if ( table .style .cssFloat != undefined )
                table .style .cssFloat = 'right' ;
        else if ( table .style .styleFloat != undefined )
                table .style .styleFloat = 'right' ;

        table .style .textAlign = 'center' ;
        div_menu .appendChild( table ) ;

        var tbody = document .createElement( 'tbody' ) ;
        table .appendChild( tbody ) ;

        var tr = document .createElement( 'tr' ) ;
        tr .style .height = '27px' ;
        tbody .appendChild( tr ) ;


	 //Tourtonne home
        var td = document .createElement( 'td' ) ;
        td .style .width = '120px' ;
	td .style .backgroundRepeat = 'no-repeat' ;
        td .style .backgroundImage = 'url(images/button.gif)';
	td .style .backgroundPosition = '50% 50%' ;
        td .onmouseover = function() { show_div( this, 'tourtonnehome' ) } ;
        td .innerHTML = '&nbsp;Tourtonne home&nbsp;' ;
	td .style .padding = '0px' ;


        tr .appendChild( td ) ;

        var tourtonnehome = new Object() ;
        tourtonnehome[ '&nbsp;Tourtonne home&nbsp;' ] = 'index_en.html' ;
        create_submenu( 'tourtonnehome', tourtonnehome ) ;

        
	//Online reserveren
        var td = document .createElement( 'td' ) ;
        td .style .width = '120px' ;
	td .style .backgroundRepeat = 'no-repeat' ;
	td .style .backgroundImage = 'url(images/button.gif)';
	td .style .backgroundPosition = '50% 50%' ;
        td .onmouseover = function() { show_div( this, 'onlinereserveren' ) } ;
        td .innerHTML = 'Reserve a Taxi' ;
	td .style .padding = '0px' ;


        tr .appendChild( td ) ;

        var onlinereserveren = new Object() ;
        onlinereserveren[ 'Reserve a Taxi' ] = 'airportservice_en.html' ;
	onlinereserveren[ 'Airportservice' ] = 'airportservice_en.html' ;
        onlinereserveren[ 'Paramaribo' ] = 'lokaalreserveren_en.html' ;
        create_submenu( 'onlinereserveren', onlinereserveren ) ;
	
	//star
	var td = document .createElement( 'td' ) ;
	td .style .width = '27px' ;
	td .style .backgroundImage = 'url(images/Star.gif)';
	td .style .backgroundRepeat = 'no-repeat' ;
	td .style .padding = '0px' ;


	tr .appendChild( td ) ;
	
        //Taxi tours
        var td = document .createElement( 'td' ) ;
        td .style .width = '120px' ;
	td .style .backgroundRepeat = 'no-repeat' ;
	td .style .backgroundImage = 'url(images/button.gif)';
	td .style .backgroundPosition = '50% 50%' ;
        td .onmouseover = function() { show_div( this, 'taxitours' ) } ;
        td .innerHTML = "Taxi Tours" ;
	td .style .padding = '0px' ;



        tr .appendChild( td ) ;

        var taxitours = new Object() ;
        taxitours[ "Taxi Tours" ] = 'tours_en.html' ;
	taxitours[ "City" ] = 'citytour_en.html' ;
	taxitours[ "Commewijne" ] = 'commewijnetour_en.html' ;
	taxitours[ "Para" ] = 'paratour_en.html' ;
        create_submenu( 'taxitours', taxitours ) ;

  	//Foto galerij
        var td = document .createElement( 'td' ) ;
        td .style .width = '120px' ;
        td .style .backgroundRepeat = 'no-repeat' ;
        td .style .backgroundImage = 'url(images/button.gif)';
        td .style .backgroundPosition = '50% 50%' ;
        td .onmouseover = function() { show_div( this, 'gallerij' ) } ;
        td .innerHTML = 'Gallery&nbsp;' ;
        td .style .padding = '0px' ;
        tr .appendChild( td ) ;

        var gallerij = new Object() ;
        gallerij[ 'Gallery&nbsp;' ] = 'gallery_en.html' ;
        create_submenu( 'gallerij', gallerij ) ;



        //Contact info
        var td = document .createElement( 'td' ) ;
        td .style .width = '120px' ;
	td .style .backgroundRepeat = 'no-repeat' ;
	td .style .backgroundImage = 'url(images/button.gif)';
	td .style .backgroundPosition = '50% 50%' ;
        td .onmouseover = function() { show_div( this, 'contactinfo' ) } ;
        td .innerHTML = '&nbsp;Contact' ;
	td .style .padding = '0px' ;
        tr .appendChild( td ) ;

        var contactinfo = new Object() ;
        contactinfo[ '&nbsp;Contact' ] = 'contactinfo_en.html' ;
        create_submenu( 'contactinfo', contactinfo ) ;
}

function create_submenu( id, menu_items )
{
        var div = document .createElement( 'div' ) ;
        div .id = id ;
        div .style .visibility = 'hidden' ;
        div .style .position = 'absolute' ;
        div .style .width = '120px' ;
	div .style .border = '0px' ;
	div .style .verticalAlign = 'top' ;
	div .style .padding = '0px' ;
	div .style .borderSpacing = '0px' ;
        div .onmouseover = function() { keep_div( this, id ) } ;
        div .onmouseout = function() { if ( hide_div != undefined ) hide_div( this, id ) } ;
        document .getElementById( 'menu' ) .appendChild( div ) ;

        var table = document .createElement( 'table' ) ;
        table .style .fontFamily = 'verdana' ;
	table .style .verticalAlign = 'top' ;
	table .style .marginTop = '0px' ;
	table .style .width = '120px' ;
        table .style .color = '#000000' ;
	table .style .padding = '0px' ;
	table .style .border = '0px' ;
	table .style .borderSpacing = '0px' ;
	table .style .borderCollapse = 'collapse' ;
        div .appendChild( table ) ;

        var tbody = document .createElement( 'tbody' ) ;
        table .appendChild( tbody ) ;

        for ( menu_item in menu_items )
        {
                tbody .appendChild( create_menuitem( menu_item, menu_items[ menu_item ] ) ) ;
        }
}

function create_menuitem( text, destination )
{
        var td = document .createElement( 'td' ) ;
        td .style .cursor = 'pointer' ;
        td .style .height = '27px' ;
        td .style .width = '120px';
	td .style .padding = '0px' ;
	td .style .border = '0px' ;
	td .style .backgroundRepeat = 'no-repeat' ;
	td .style .letterSpacing = '-1px' ;
        td .style .fontFamily = 'verdana' ;
	td .style .borderSpacing = '0px' ;
	td .style .fontWeight = 'bold' ;
        td .style .fontSize = '12px' ;
	td .style .backgroundPosition = '50% 50%' ;
	td .style .textAlign = 'center' ;
        td .style .backgroundImage = 'url(images/button.gif)' ;
        td .onclick = function() { window.location = destination } ;
        td .onmouseover = function() { this, td .style .backgroundImage = 'url(images/buttonhighlighted.gif)' } ;
        td .onmouseout = function() { this, td .style .backgroundImage = 'url(images/button.gif)' } ;
        td .innerHTML = text ;

  	var tr = document .createElement( 'tr' ) ;
        tr .appendChild( td ) ;

        return tr ;
}



