//loadHeader
path='img/menu/';
Div=new Array;
Div[1]='menuSubCategory';
Div[2]='menuSubSubCategory';
Div[3]='menuSubSubCategory';
idselected=new Array;
idselected[1]='';
idselected[2]='';
idselected[3]='';
imgNamesCompany=new Array("company_history","company_vision");
imgNamesPartners=new Array("partners_trafica","partners_arde","partners_d","partners_thecouncil","partners_venue");
imgNamesClients=new Array("clients_casestudies","clients_clientlists");
imgNamesClientsCaseStudie=new Array("clients_casestudies_bahiabeach","clients_casestudies_click2build");
imgNamesContact=new Array("contact_northamerica","contact_southamerica","contact_europe","contact_middleeast");
imgNamesProtfolio=new Array("portfolio_acquavallarta","portfolio_akiabara","portfolio_bahiabeach","portfolio_galileo","portfolio_iconbrickell","portfolio_itecdesign","portfolio_laforcestevens","portfolio_longwood","portfolio_mezzo","portfolio_nikeap9","portfolio_onyxchelsea","portfolio_stregisbalharbour","portfolio_theclarendon","portfolio_theveneto","portfolio_viceroy","portfolio_yoopuntadeleste");
imgNamesOnlinemkt=new Array("services_onlinemkt_emailmkt","services_onlinemkt_eplanning","services_onlinemkt_googleads","services_onlinemkt_onlineadvertising","services_onlinemkt_seo");
imgNamesServicesDesign=new Array("services_design_webdesign","services_design_ecommerce","services_design_creative","services_design_content");
imgNamesConsultancy=new Array("services_consultancy_strategy","services_consultancy_traffic","services_consultancy_usability");
imgNamesProduct= new Array("services_products_emkt","services_products_floorplan");
imgNamesServices=new Array("services_design", "services_onlinemkt", "services_consultancy", "services_products");
imgNamesMain=new Array("services", "portfolio", "company", "partners", "clients", "contact", "careers");
window.addEvent('domready',
function (){
	if(window.navigator.appName.toLowerCase()=='netscape' || window.navigator.appName.toLowerCase()=='opera')
    {
	 document.body.style.overflowY='scroll';
	 document.body.style.overflowX='hidden';
	}
   	alto = window.getHeight();
	ancho = window.getWidth();
	margen_alto=(alto-581)/2;
	margen_ancho=(ancho-960)/2;
	$('content').style.marginLeft=margen_ancho+"px";
	//$('content').style.marginTop=margen_alto+"px";
	var Copyright = new Fx.Styles($('Copyright'), {duration:300, wait:false});
	$('Copyright').addEvent('mouseover', function() 
	{ 
	 Copyright.start({
				'width': '520px',
				'marginLeft': '441px'
			});
	});
	$('Copyright').addEvent('mouseout', function() 
	{
	 Copyright.start({
				'width': '9px',
				'marginLeft': '951px'
			});
	});
	
	
});
window.addEvent('resize',function(){
	alto = window.getHeight();
	ancho = window.getWidth();
	margen_alto=(alto-581)/2;
	margen_ancho=(ancho-960)/2;
	$('content').style.marginLeft=margen_ancho+"px";
	//$('content').style.marginTop=margen_alto+"px";
});
function setEventImage(id,namesImg,nivel)
{
 $(namesImg[id]).addEvent('mouseover', function() { 
 $(namesImg[id]).setProperty('src', path+namesImg[id]+'_over.gif'); 
												  });
 $(namesImg[id]).addEvent('mouseout', function() { 
		for(i=0;i<=namesImg.length-1;i++)
		{
		 $(namesImg[i]).setProperty('src', path+namesImg[i]+'.gif');
		}
		if(idselected[nivel]!="")
		{
		 $(idselected[nivel]).setProperty('src', path+idselected[nivel]+'_over.gif'); 
		}
 });
 $(namesImg[id]).addEvent('mousedown', function() { 
		for(i=0;i<=namesImg.length-1;i++)
		{
		 if(id!=i)
		 {
		   $(namesImg[i]).setProperty('src', path+namesImg[i]+'.gif');
		 }
		}
		idselectedOld=9;
		if(namesImg[id]=="services_design" || namesImg[id]=="services_onlinemkt" || namesImg[id]=="services_consultancy" || namesImg[id]=="clients_clientlists" || namesImg[id]=="careers")
		{
		 idselectedOld=namesImg[id];
		}
		idselected[nivel]=namesImg[id];
		if(nivel<=2)
		{
		 if(nivel==2)
		 {
		  $('menuSubSubCategory').style.display='';
		 }
		 else
		 {
  		  $('menuSubSubCategory').style.display='none';	 
		 }
		 $('menuSubCategory').style.display='';
		 var myAjax = new Ajax(namesImg[id]+'.htm', {method: 'get', update: $(Div[nivel]), evalScripts: true});
		 myAjax.request();
		}
		else
		{
	    // $('hola').innerHTML=namesImg[id];
		 loadswf(namesImg[id]+'.swf');	

		 if(namesImg[id]=="clients_clientlists")
		 {
		  $('menuSubSubCategory').style.display='none';
		  idselected[2]=namesImg[id];
		  idselected[nivel]=idselectedOld;
		 }
		 if(namesImg[id]=="services_design" || namesImg[id]=="services_onlinemkt" || namesImg[id]=="services_consultancy" )
		 {
		  $('menuSubSubCategory').style.display='none';
		  idselected[2]=namesImg[id];
		  idselected[nivel]=idselectedOld;
		 }
		 if(namesImg[id]=="careers")
		 {
		  idselected[1]=namesImg[id];
		  idselected[nivel]=idselectedOld;
		  $('menuSubSubCategory').style.display='none';
		  $('menuSubCategory').style.display='none';
		 }
		}
 });
}	
function methodReady(html)
{
 len=html.length-4;
 html=html.substring(4,len);
 var myAjax = new Ajax(html+'.htm', {
					   				 method: 'get', 
									 update: $('description'), 
									 evalScripts: true, 
									 onComplete: function() {
												PrintFooter();}
									});
 myAjax.request();
}
function thisMovie(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
}
function flashReady()
{
 loadswf('home.swf');
}
function loadswf(swf)
{
 thisMovie("Flash").loadHeader('swf/'+swf);
}
function getSwf(swf)
{
 var so = new SWFObject("swf/loader.swf", "Flash", "960", "394", "8", "#F4F4F0");
 so.addParam("wmode", "transparent");
 so.addParam("allowScriptAccess","always");
 so.write("contentSwf");
}
function PrintFooter()
{
 if($('description').offsetHeight<120)
 {
  if(!window.ie)
  {
   $('ContentFooter').style.marginTop=145+"px";
  }
  else
  {
   $('ContentFooter').style.marginTop=0+"px";
  }
 }
 else
 {
  if(!window.ie)
  {
   $('ContentFooter').style.marginTop=$('description').offsetHeight+25+"px"; 
  }
  else
  {
   if(!$('ContentFooter').style.offsetTop)
   {
    offsetTop=0;	 
   }
   else
   {
    offsetTop=$('ContentFooter').style.offsetTop;
   }
   TopFooter=offsetTop;
   $('ContentFooter').style.top=TopFooter;
  }
 }
}