lngGeral=1;

function FlashLibrary(){ 
    var t = this; 
    var activeX = false; 
    t.ieAutoInstall = false; 
    t.hasVersion = function(ver){ 
        t.swf = false; 
        if(!ver) ver = 0; 
        var n = navigator; 
        if(n.plugins && n.plugins.length > 0){ 
            var m,tp,d,v; 
            m = n.mimeTypes; 
            tp = 'application/x-shockwave-flash'; 
            if(m && m[tp] && m[tp].enabledPlugin && m[tp].enabledPlugin.description){ 
                d = m[tp].enabledPlugin.description; 
                v = d.charAt(d.indexOf('.')-1); 
                t.swf = (v >= ver) ? true : false; 
            } 
        }else if(n.appVersion.indexOf("Mac") == -1 && window.execScript){ 
            for(var i=ver; i<=7&&i!=1&&t.swf!=true; i++){ 
                execScript('on error resume next: flash.swf=IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash'+((i==0)?'':'.'+i)+'"))','VBScript'); 
                //alert(t.swf); 
            } 
            if(t.swf) { 
                activeX = true; 
                //alert('poo is true'); 
          } 
        }else{ 
            t.swf = false; 
        } 
        return t.swf; 
    } 
    t.getPluginTag = function(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags){ 
        var s = ''; 
        var safari = (navigator.userAgent.toLowerCase().indexOf('safari') != - 1); 
        var win = (navigator.appVersion.toLowerCase().indexOf("win")!=-1); 
        var ie = (navigator.appName=="Microsoft Internet Explorer"); 
		var additionalParams = ''; 
		var name=(name==undefined)? 'flashObj' : name;
		if(params && params.length>0){ 
			var pArray = params.split(","); 
			for(var i=0; i<pArray.length; i++){ 
				var ta = pArray[i].substr(0,pArray[i].indexOf('=')); 
				var v = pArray[i].substr(pArray[i].indexOf('=')+1,pArray[i].length); 
				additionalParams += (activeX)?'\t<param name="' + ta + '" value="' + v + '" />\n': ' '+ ta + '="' + v + '"'; 
			} 
		} 
		if(activeX){ 
			s = '<object id="'+name+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,21,0" width="'+width+'" height="'+height+'" '+pTags+'>\n'; 
			s += '\t<param name="movie" value="'+swfFile+'" />\n'; 
			s += '\t<param name="quality" value="high" />\n'; 
			s += '\t<param name="menu" value="false" />\n'; 
			s += '\t<param name="bgcolor" value="'+bgcolor+'" />\n'; 
			s += additionalParams; 
			s += altFormat; 
			s += '</object>\n'; 
			return s; 
		}else{ 
			s = '<embed id="'+name+'" src="'+swfFile+'" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'"'+additionalParams+(safari?' class="safari"':'')+'></embed>\n'; 
			return s; 
		} 
    } 
    t.embedMovie = function(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags,retu){ 
		if(retu)
			return flash.getPluginTag(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags);
		else
	        document.write(flash.getPluginTag(swfFile,width,height,bgcolor,ver,altFormat,params,name,pTags)); 
    } 
} 
var flash = new FlashLibrary();


function openOnline(c){
	obj=document.getElementById("atendimento");
	if(c==undefined)
		obj.style.visibility="visible";
	else
		obj.style.visibility="hidden";
	
	
}
function init(){
	t=window.location.toString();
	if(t.indexOf("?")==-1)
		menu('home');
	else
		menu(t.substr(t.indexOf("?")+1));
}
var menuatual=null;
function menu(l){
	if(menuatual!=l){
		t=window.location.toString();
			
/*		if(t.indexOf(l)==-1)
			window.location=trata(t)+"?"+l;
		else {*/
			if(t.indexOf("?")>-1)
				l=t.substr(t.indexOf("?")+1);

			if(l=="localizacao"){
				load_maps('content');
			} else {
				obj=document.getElementById('content');
				obj.innerHTML=flash.embedMovie('swf/'+l+'_content.swf','100%','100%','#FFFFFF',5,'<img src="imagem" alt="" />','wmode=transparent,scale=noscale','contentSwf','',true);
			}
//		}
		menuatual=l;
	}
}
function trata(t){
	return  (t.indexOf("?")>-1)? t.substr(0,t.indexOf("?")) : t;
}


var map;
var i=0;
var icons=Array();

function createMarker(point, icon, htmlText) {
	var infoTabs = [
	  new GInfoWindowTab("tab"+(i+1), htmlText)
	];
  var marker = new GMarker(point,icon.icon);
  GEvent.addListener(marker, "click", function() {
	marker.openInfoWindowTabsHtml(infoTabs);
  });
  map.addOverlay(marker);
  marker.openInfoWindowTabsHtml(infoTabs);
}
function mapIcon(obj){
	var new_icon = new GIcon();
		new_icon.image = obj.src;  
		new_icon.size = new GSize(obj.w,obj.h);
		new_icon.iconAnchor = new GPoint(obj.x,obj.y);
		new_icon.infoWindowAnchor = new GPoint(obj.xi,obj.yi);

	var opt = {};
		opt.icon = new_icon;
		opt.draggable = false;
		opt.clickable = true;
		opt.dragCrossMove = false;
		opt.title=obj.title;
	
	return opt;
}
function load_maps(l) {
  if (GBrowserIsCompatible()) {
	m=document.getElementById(l==undefined? "map" : l);
	if(m!=undefined){
		icons.push(mapIcon({src: "imagens/map/rosecon.png",			 	title: "Rosecon", w: 60, h: 60, x: 16, y : 40, xi: 30, yi: 2}));
		icons.push(mapIcon({src: "imagens/map/pontoRef.png", 			title: "Ponto de refer&ecirc;ncia"	, w: 32, h: 40, x: 16, y : 40, xi: 18, yi: 2}));
		icons.push(mapIcon({src: "imagens/map/ocean.png",			 	title: "Ocean Towers Residence", w: 60, h: 60, x: 16, y : 40, xi: 30, yi: 2}));
		icons.push(mapIcon({src: "imagens/map/obras.png",			 	title: "Obras Realizadas", w: 60, h: 60, x: 16, y : 40, xi: 30, yi: 2}));
		
		map = new GMap2(m);

		map.enableDoubleClickZoom();
		map.enableContinuousZoom();
		map.enableScrollWheelZoom();

		var mapTypeControl = new GMapTypeControl();
		var pos = new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(10,160));
		map.addControl(mapTypeControl, pos);

		var mapLargeControl = new GLargeMapControl();
		var pos = new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(10,150));
		map.addControl(mapLargeControl, pos);

		pointCenter=new GLatLng(-27.114523016250764, -48.609368205070496);
		map.setCenter(pointCenter, 16);

		map.setMapType(G_HYBRID_MAP);

		createMarker(new GLatLng(-27.12756715701816, -48.601890206336975),icons[1],"<div class='texto'><b>Cal&ccedil;ad&atilde;o Praia Shopping</b></div>");
		createMarker(new GLatLng(-27.128636594498637, -48.60106408596039),icons[1],"<div class='texto'><b>Shopping Russi & Russi</b></div>");
		createMarker(new GLatLng(-27.129276342388177, -48.60431492328644),icons[1],"<div class='texto'><b>Caixa Econ&ocirc;mica Federal</div>");
		createMarker(new GLatLng(-27.124955585906153, -48.60372483730316),icons[1],"<div class='texto'><b>Banco do Brasil</b></div>");
		createMarker(new GLatLng(-27.122000187826167, -48.60618710517883),icons[1],"<div class='texto'><b>Banco HSBC</b></div>");
		createMarker(new GLatLng(-27.120176300612836, -48.606900572776794),icons[1],"<div class='texto'><b>Banco Ita&uacute;</b></div>");
		createMarker(new GLatLng(-27.129963828577683, -48.600372076034546),icons[1],"<div class='texto'><b>Banco Bradesco</b></div>");
		createMarker(new GLatLng(-27.125614452377267, -48.60380530357361),icons[1],"<div class='texto'><b>Posto de Combust&iacute;vel ESSO</b></div>");
		createMarker(new GLatLng(-27.11856724453439, -48.60796272754669),icons[1],"<div class='texto'><b>Shopping Andorinha</b></div>");
		createMarker(new GLatLng(-27.1215370569789, -48.605870604515076),icons[1],"<div class='texto'><b>Supermercado Mini Pre&ccedil;o</b></div>");
		createMarker(new GLatLng(-27.123547126447707, -48.60457241535187),icons[1],"<div class='texto'><b>Restaurante Cabral</b></div>");
		createMarker(new GLatLng(-27.12652635536478, -48.60309183597565),icons[1],"<div class='texto'><b>Restaurante Yucum&atilde;</b></div>");
		createMarker(new GLatLng(-27.128402655923675, -48.60182583332062),icons[1],"<div class='texto'><b>Restaurante Alberto&prime;s</b></div>");
		createMarker(new GLatLng(-27.133735378998523, -48.59785079956055),icons[1],"<div class='texto'><b>Itapani 24h</b></div>");
		createMarker(new GLatLng(-27.134518317822863, -48.59780251979828),icons[1],"<div class='texto'><b>Shopping Show</b></div>");
		createMarker(new GLatLng(-27.13577387290543, -48.596895933151245),icons[1],"<div class='texto'><b>Restaurante Yucum&atilde;</b></div>");
		createMarker(new GLatLng(-27.135764325011248, -48.59707832336426),icons[1],"<div class='texto'><b>Locadora de DVD</b></div>");
		createMarker(new GLatLng(-27.135778646852216, -48.59646141529083),icons[1],"<div class='texto'><b>Padaria</b></div>");
		createMarker(new GLatLng(-27.127906131612338, -48.60902488231659),icons[1],"<div class='texto'><b>Supermercado Koch</b></div>");
		createMarker(new GLatLng(-27.131329240003616, -48.59984636306763),icons[1],"<div class='texto'><b>Supermercado S&atilde;o Jos&eacute;</b></div>");
		createMarker(new GLatLng(-27.11556870439981, -48.60997974872589),icons[1],"<div class='texto'><b>Posto de Combust&iacute;vel Petrobras</b></div>");
		createMarker(new GLatLng(-27.137502028322036, -48.59573721885681),icons[1],"<div class='texto'><b>Posto de Combust&iacute;vel Shell</b></div>");
		createMarker(new GLatLng(-27.13703896167316, -48.59604299068451),icons[1],"<div class='texto'><b>Igreja Cat&oacute;lica</b></div>");
		createMarker(new GLatLng(-27.134575605814234, -48.596654534339905),icons[3],"<div class='texto'><b>Res. Anthurium</div>");
		createMarker(new GLatLng(-27.131329240003616, -48.598113656044006),icons[3],"<div class='texto'><b>Classic Palace Res. Bloco A</div>");
		createMarker(new GLatLng(-27.131429496828854, -48.59831750392914),icons[3],"<div class='texto'><b>Classic Palace Res. Bloco B</div>");
		createMarker(new GLatLng(-27.1321599366995, -48.59730362892151),icons[3],"<div class='texto'><b>Cristal Palace</div>");
		createMarker(new GLatLng(-27.099490766261944, -48.61408352851868),icons[3],"<div class='texto'><b>Ed. Djalma Bento</div>");
		createMarker(new GLatLng(-27.12639267371653, -48.60221743583679),icons[3],"<div class='texto'><b>Res. Eduardo Gustavo</div>");
		createMarker(new GLatLng(-27.137979414611703, -48.592175245285034),icons[3],"<div class='texto'><b>Franci Palece Res.</div>");
		createMarker(new GLatLng(-27.130054538245385, -48.602174520492554),icons[3],"<div class='texto'><b>Res. Graziela</div>");
		createMarker(new GLatLng(-27.099142154559537, -48.61479163169861),icons[3],"<div class='texto'><b>Liberty Palace Res.</div>");
		createMarker(new GLatLng(-27.131362658955343, -48.59848380088806),icons[3],"<div class='texto'><b>Meridien Res.</div>");
		createMarker(new GLatLng(-27.11431769733859, -48.609121441841125),icons[3],"<div class='texto'><b>Real Palace Res.</div>");
		createMarker(new GLatLng(-27.098702806758535, -48.614373207092285),icons[3],"<div class='texto'><b>Res. San Pyter</div>");
		createMarker(new GLatLng(-27.132078776949512, -48.597389459609985),icons[3],"<div class='texto'><b>Sollar Palece Res.</div>");
		createMarker(new GLatLng(-27.130150022026626, -48.602362275123596),icons[3],"<div class='texto'><b>Res. Sueli</div>");
		createMarker(new GLatLng(-27.102265294676183, -48.61483454704285),icons[3],"<div class='texto'><b>Summer Palace Res.</div>");
		createMarker(new GLatLng(-27.135143710139857, -48.59678864479065),icons[2],"<div class='texto'><b>Ocean Towers Residence</div>");
		createMarker(new GLatLng(-27.11449436712284, -48.609373569488525),icons[0],"<div class='texto'><b>ROSECON</div>");

	}
  }
}

function idioma(lng){
	if(lng==undefined){
		idioma(lngGeral);
	} else {
		m=document.getElementById("menu");
		c=document.getElementById("contentSwf");
		m.SetVariable('varIdioma',lng);
		c.SetVariable('varIdioma',lng);
		lngGeral=lng;
	}
}