function initialize() {
    //create INDUSTRIAL tab
    var temp;
    var table = Builder.node('table', {
        width:'100%',
        border:'0',
        cellspacing:'0',
        cellpadding:'0',
        id:'tabindustrials'
    });

    var tbody = Builder.node('tbody'),
    tr = Builder.node('tr', { className: 'industrial'}),
    td1 = Builder.node('td', { className: 'tabfirstcell' }, [Builder.node('img', { src: 'images/ImgIndustrialsHeader.gif', alt: 'Future Industrials', title: 'Future Industrials' })]);
    td2 = Builder.node('td', { className: 'tabsep' }, '|');   
    td3 = Builder.node('td', { className: 'tabheading', align: 'left' }, 'INDUSTRIALS');
    td4 = Builder.node('td', { className: 'tablast', align: 'right' }, 'explore + ');

    tr.appendChild(td1);
    tr.appendChild(td2);
    tr.appendChild(td3);
    tr.appendChild(td4);
    tbody.appendChild(tr);
    table.appendChild(tbody);

    temp = $('industrials').previous(1);
    $('industrials').previous(0).insert({after: table});
    temp.hide();





    //create ENGINEERING tab
    table = Builder.node('table', {
        width: '100%',
        border: '0',
        cellspacing: '0',
        cellpadding: '0',
        id:'tabengineering'
    });

    tbody = Builder.node('tbody'),
    tr = Builder.node('tr', { className: 'engineering' }),
    td1 = Builder.node('td', { className: 'tabfirstcell' }, [Builder.node('img', { src: 'images/ImgEngineeringHeader.gif', alt: 'Future Engineering', title: 'Future Engineering' })]);
    td2 = Builder.node('td', { className: 'tabsep' }, '|');
    td3 = Builder.node('td', { className: 'tabheading', align: 'left' }, 'ENGINEERING');
    td4 = Builder.node('td', { className: 'tablast', align: 'right' }, 'explore + ');   

    tr.appendChild(td1);
    tr.appendChild(td2);
    tr.appendChild(td3);
    tr.appendChild(td4);
    tbody.appendChild(tr);
    table.appendChild(tbody);

    temp = $('engineering').previous(1);
    $('engineering').previous(0).insert({ after: table });
    temp.hide();




    
    //create REALTY tab
    table = Builder.node('table', {
        width: '100%',
        border: '0',
        cellspacing: '0',
        cellpadding: '0',
        id:'tabrealty'
    });

    tbody = Builder.node('tbody'),
    tr = Builder.node('tr', { className: 'realty' }),
    td1 = Builder.node('td', { className: 'tabfirstcell' }, [Builder.node('img', { src: 'images/ImgRealtyHeader.gif', alt: 'Future Realty', title: 'Future Realty' })]);
    td2 = Builder.node('td', { className: 'tabsep' }, '|');
    td3 = Builder.node('td', { className: 'tabheading', align: 'left' }, 'REALTY');
    td4 = Builder.node('td', { className: 'tablast', align: 'right' }, 'explore + ');
      
    
    tr.appendChild(td1);
    tr.appendChild(td2);
    tr.appendChild(td3);
    tr.appendChild(td4);
    tbody.appendChild(tr);
    table.appendChild(tbody);

    temp = $('realty').previous(1);
    $('realty').previous(0).insert({ after: table });
    temp.hide();





    //create INVESTMENTS tab
    table = Builder.node('table', {
        width: '100%',
        border: '0',
        cellspacing: '0',
        cellpadding: '0',
        id: 'tabinvestments'
    });

    tbody = Builder.node('tbody'),
    tr = Builder.node('tr', { className: 'investments' }),
    td1 = Builder.node('td', { className: 'tabfirstcell' }, [Builder.node('img', { src: 'images/ImgInvestmentsHeader.gif', alt: 'Future Investments', title: 'Future Investments' })]);
    td2 = Builder.node('td', { className: 'tabsep' }, '|');
    td3 = Builder.node('td', { className: 'tabheading', align: 'left' }, 'INVESTMENTS');
    td4 = Builder.node('td', { className: 'tablast', align: 'right' }, 'explore + ');
    
    tr.appendChild(td1);
    tr.appendChild(td2);
    tr.appendChild(td3);
    tr.appendChild(td4);
    tbody.appendChild(tr);
    table.appendChild(tbody);

    temp = $('investments').previous(1);
    $('investments').previous(0).insert({ after: table });
    temp.hide();




    //create PHILANTHROPY tab
    table = Builder.node('table', {
        width: '100%',
        border: '0',
        cellspacing: '0',
        cellpadding: '0',
        id:'tabphilanthropy'
    });

    tbody = Builder.node('tbody'),
    tr = Builder.node('tr', { className: 'philanthropy' }),
    td1 = Builder.node('td', { className: 'tabfirstcell' }, [Builder.node('img', { src: 'images/ImgPhilanthropyHeader.gif', alt: 'Future Philanthropy', title: 'Future Philanthropy' })]);
    td2 = Builder.node('td', { className: 'tabsep' }, '|');
    td3 = Builder.node('td', { className: 'tabheading', align: 'left' }, 'PHILANTHROPY');
    td4 = Builder.node('td', { className: 'tablast', align: 'right' }, 'explore + ');   
  
    tr.appendChild(td1);
    tr.appendChild(td2);
    tr.appendChild(td3);
    tr.appendChild(td4);
    tbody.appendChild(tr);
    table.appendChild(tbody);

    temp = $('philanthropy').previous(1);
    $('philanthropy').previous(0).insert({ after: table });
    temp.hide();

   
   
    //create DEVELOPERS tab    
    table = Builder.node('table', {
        width: '100%',
        border: '0',
        cellspacing: '0',
        cellpadding: '0',
        id: 'tabdevelopers'
    });

    tbody = Builder.node('tbody'),
    tr = Builder.node('tr', { className: 'developers' }),
    td1 = Builder.node('td', { className: 'tabfirstcell' }, [Builder.node('img', { src: 'images/ImgDevelopersHeader.gif', alt: 'Future Developers', title: 'Future Developers' })]);
    td2 = Builder.node('td', { className: 'tabsep' }, '|');
    td3 = Builder.node('td', { className: 'tabheading', align: 'left' }, 'DEVELOPERS');
    td4 = Builder.node('td', { className: 'tablast', align: 'right' }, 'explore + ');
    
    tr.appendChild(td1);
    tr.appendChild(td2);
    tr.appendChild(td3);
    tr.appendChild(td4);
    tbody.appendChild(tr);
    table.appendChild(tbody);

    temp = $('developers').previous(1);
    $('developers').previous(0).insert({ after: table });
    temp.hide();




    //Add listeners to events

    Event.observe('tabindustrials', 'mouseover', function(event) {
        this.style.cursor = 'pointer';
    });

    Event.observe('tabindustrials', 'click', function(event) {
        toggledisplay('industrials');
        return false;
    });

    Event.observe('tabengineering', 'mouseover', function(event) {
        this.style.cursor = 'pointer';
    });

    Event.observe('tabengineering', 'click', function(event) {
        toggledisplay('engineering');
        return false;
    });

    Event.observe('tabrealty', 'mouseover', function(event) {
        this.style.cursor = 'pointer';
    });

    Event.observe('tabrealty', 'click', function(event) {
        toggledisplay('realty');
        return false;
    });

    Event.observe('tabinvestments', 'mouseover', function(event) {
        this.style.cursor = 'pointer';
    });

    Event.observe('tabinvestments', 'click', function(event) {
        toggledisplay('investments');
        return false;
    });

    
    Event.observe('tabphilanthropy', 'mouseover', function(event) {
        this.style.cursor = 'pointer';
    });

    Event.observe('tabphilanthropy', 'click', function(event) {
        toggledisplay('philanthropy');
        return false;
    });
	
	
	Event.observe('tabdevelopers', 'mouseover', function(event) {
        this.style.cursor = 'pointer';
    });

    Event.observe('tabdevelopers', 'click', function(event) {
        toggledisplay('developers');
        return false;
    });

    
    
    Event.observe('legacy', 'mouseover', function(event) {      
        var relTag = event.target || event.srcElement;


        if (relTag.nodeName == 'A') 
        {
            if (relTag.innerHTML == 'Fouad M. Makhzoumi') 
            {
                $('legacyintro').hide();
                $('legacyFouad').show();
            }
            else 
            {                
                $('legacyFouad').hide();
                $('legacyintro').show();
            }
        }
        else {
            $('legacyFouad').hide();
            $('legacyintro').show();
        }

        event.cancelBubble = true;
        if (event.stopPropagation) event.stopPropagation();
    });


    Event.observe('legacy', 'mouseout', function (event) 
    {

        var relTag = event.target || event.srcElement;

        if (relTag.nodeName == 'A' || relTag.nodeName == 'DIV') 
        {
            $('legacyintro').show();
        }
        else {           
        }
        event.cancelBubble = true;
        if (event.stopPropagation) event.stopPropagation();
    });



    Event.observe('aboutus', 'mousemove', function (event) 
    {
        if (!event) var event = window.event;

        var relTag = event.target || event.srcElement;

        if (relTag.nodeName == 'A') 
        {
            if (relTag.innerHTML == 'Fouad M. Makhzoumi') 
            {
                $('teamintro').hide();
                $('teamAshur').hide();                
                $('teamFouad').show();
            }

            else if (relTag.innerHTML == 'Dr. Omar Ashur') 
            {
                $('teamintro').hide();
                $('teamFouad').hide();
                $('teamAshur').show();
            }

            else if (relTag.innerHTML == 'Michael N. Dakin') 
            {
                $('teamintro').hide();
                $('teamFouad').hide();
                $('teamAshur').hide();
               
            }
            
            else {
                $('teamFouad').hide();
                $('teamAshur').hide();               
                $('teamintro').show();
            }
        }
        else {
            $('teamFouad').hide();
            $('teamAshur').hide();           
            $('teamintro').show();
        }      
    });


    Event.observe('aboutus', 'mouseout', function (event) 
    {
    $('teamFouad').hide();
    $('teamAshur').hide();  
  

        event.cancelBubble = true;
        if (event.stopPropagation) event.stopPropagation();
    });

    Event.observe('subsidiaries', 'mouseover', function (event) 
    {
    $('teamFouad').hide();
    $('teamintro').show();
    $('teamAshur').hide();
   
});
	


    Event.observe('philanthropy', 'mousemove', function(event) {
        var relTag = event.target || event.srcElement;
        if (relTag.nodeName == 'A') {
            if (relTag.innerHTML == 'Mrs. May Makhzoumi') {
                $('fpintro').hide();
                $('fpmay').show();
            }
            else 
            {
                $('fpmay').hide();
                $('fpintro').show();
            }
        }
        else 
        {
            $('fpmay').hide();
            $('fpintro').show();
        }
    });

    Event.observe('philanthropy', 'mouseout', function (event) 
    {
        $('fpmay').hide();
    });


    
    Event.observe('investments', 'mousemove', function(event) 
	{
        var relTag = event.target || event.srcElement;
        if (relTag.nodeName == 'A') 
		{
            

        }
        else 
		{
			$('fnintro').show();           
        }
    });

    Event.observe('investments', 'mouseout', function(event) 
	{       
    });


    Event.observe('realty', 'mousemove', function (event) 
    {
        var relTag = event.target || event.srcElement;
        if (relTag.nodeName == 'A') 
        {

            if (relTag.innerHTML == 'Antoine Habib') 
            {
                $('frintro').hide();
                $('frAntoine').show();
            }
            else 
            {
                $('frAntoine').hide();
                $('frintro').show();
            }
        }
        else 
        {
            $('frAntoine').hide();
            $('frintro').show();
        }
    });

    Event.observe('realty', 'mouseout', function(event) 
    {
        $('frAntoine').hide();
    });


    Event.observe('engineering', 'mousemove', function (event) 
    {
        var relTag = event.target || event.srcElement;
        if (relTag.nodeName == 'A') 
		{

            if (relTag.innerHTML == 'Dionissis Davios') 
			{
                $('feintro').hide();
                $('feDavios').show();
            }
            else 
			{
                $('feDavios').hide();
                $('feintro').show();
            }
        }
        else 
		{
            $('feDavios').hide();
            $('feintro').show();
        }
    });

    Event.observe('engineering', 'mouseout', function (event) 
    {
        $('feDavios').hide();
    });


    Event.observe('industrials', 'mousemove', function (event) 
    {
        var relTag = event.target || event.srcElement;       
        if (relTag.nodeName == 'A') {
            
		if (relTag.innerHTML == 'Dr. Omar Ashur') 
            {
                $('fiintro').hide();
                $('fiOmarAshur').show();
            }
            else 
            {
                $('fiOmarAshur').hide();
                $('fiintro').show();
            }
        }
        else 
        {
            $('fiOmarAshur').hide();
            $('fiintro').show();
        }
    });

    Event.observe('industrials', 'mouseout', function (event) 
    {
    $('fiOmarAshur').hide();
    
});
  

    //end of initialize
    preloader();
    teamduplicate();
    subsidiariesduplicate();    
    legacyduplicate();
    contactduplicate();  
}

var divopen = '';
var maps = new Array();
var total_loaded = 0;
var images = new Array(6);
var boxup = false;


function imagesLoaded() {
    $('fmhgcontact').writeAttribute('src', 'images/ImgFutureMapMain.gif');
    
}


function showmap(sno)
{
    var imageObj = new Image();
    imageObj.src = images[sno];
    $('fmhgcontact').writeAttribute('src', imageObj.src);

    if (sno != 0) 
    {
            var a = $('tipClick').childElements();
            a[0].update('Click on the highlighted area of the map to view the address.');
            $('tipClick').appear({ duration: 0.5 });      
    }
        else 
    {
         $('tipClick').hide({ duration: 0.5 });
    }
 }


function engagetip() 
{
    var a = $('tipClick').childElements();
    a[0].update('Click on the highlighted area of the map to view the address.');
    $('tipClick').hide({ duration: 0.5 });
}

function disengagetip() 
{
    var a = $('tipClick').childElements();
    if(!boxup){
        a[0].update('Move the mouse pointer over the map to view the addresses');
        $('tipClick').appear({ duration: 0.5 });
    }
}

function closebox(boxname) 
{
    $(boxname).hide();
    boxup = false;
}

function showAddress(addressbox) 
{
    if (!boxup)
        Effect.Appear(addressbox);
    else 
    {
        var a = $('tipClick').childElements();
        a[0].update('Please close the address box to view another address.');
        $('tipClick').appear({ duration: 0.5 });
    }
        
    boxup = true;
}

function preloader() {
    var i = 0;

    var imageObj = new Image();

    imageObj.onLoad = imagesLoaded();
    //set image list
    images[0] = "images/ImgFutureMapMain.gif";
    images[1] = "images/ImgFutureMap1.gif";
    images[2] = "images/ImgFutureMapMiddleEast.gif";
    images[3] = "images/ImgFutureMapAfrica.gif";
    images[4] = "images/ImgFutureMapEurope.gif";
    images[5] = "images/ImgFutureMapAsia.gif";



    for (i = 0; i <= 5; i++) 
    {
        imageObj.src = images[i];
    }
   
}

function toggledisplay(divname) 
{
    var obj;
    if (divopen != divname) {
        if (divopen != '') {
            obj = locateCell(divopen);
            replaceCellText(obj, 'explore + ');
            Effect.BlindUp(divopen, { duration: 0.5 });
        }
        obj = locateCell(divname);

        replaceCellText(obj, 'explore - ');

        Effect.BlindDown(divname, { duration: 0.5 });
        divopen = divname;
        setTimeout('Effect.ScrollTo(\'' + divname + 'bar\');', 600);
    }
    else {
        obj = locateCell(divname);
        replaceCellText(obj, 'explore + ');
        Effect.BlindUp(divname, { duration: 0.5 });
        divopen = '';
        Effect.ScrollTo('subsidiaries');
    }
    return false;
}

function locateCell(divname)
 {
    var tbody = $(divname).previous(0).childElements();

    var tr;
    if(Prototype.Browser.IE)
        tr = tbody[1].childElements();
    else
        tr = tbody[0].childElements();
    var cells = tr[0].childElements();
    return cells[3];
}

function replaceCellText(obj,reptext) {
    obj.update(reptext);
}


function contactduplicate()
{
    var addressbox = cloneElement($('addressbox1'));
    $('addresslist').appendChild(addressbox);
    
    addressbox = cloneElement($('addressbox2'));
    $('addresslist').appendChild(addressbox);

    addressbox = cloneElement($('addressbox3'));
    $('addresslist').appendChild(addressbox);

    addressbox = cloneElement($('addressbox5'));
    $('addresslist').appendChild(addressbox);
    
    addressbox = cloneElement($('addressbox4'));
    $('addresslist').appendChild(addressbox);

}

function legacyduplicate() 
{
    
    var legacy = cloneElement($('legacyFouad'));
    $('legacyprint').appendChild(legacy);

}

function teamduplicate() 
{
    var team = cloneElement($('teamFouad'));
    $('teamforprint').appendChild(team);


    team = cloneElement($('teamAshur'));
    $('teamforprint').appendChild(team); 
}

function subsidiariesduplicate() 
{
    
    var bio = cloneElement($('fiOmarAshur'));
    $('fiprint').appendChild(bio);

    bio = cloneElement($('feDavios'));
    $('feprint').appendChild(bio);

    bio = cloneElement($('frAntoine'));
    $('frprint').appendChild(bio);  

    bio = cloneElement($('fpmay'));
    $('fpprint').appendChild(bio);
}

function cloneElement(element) 
{
    var clone = new Element(element.tagName);
    clone.update(element.innerHTML);
    return clone;
}



