//*****************************************************************************
//* Executar arquivos FLASHES sem solicitar para ativar Control-X
//*****************************************************************************

	function ExecSwf(url,width,height,salign,idnome) {
		if (AC_FL_RunContent == 0) {
			alert("This page requires AC_RunActiveContent.js. In Flash, run \'Apply Active Content Update\' in the Commands menu to copy AC_RunActiveContent.js to the HTML output folder.");
		} else {
			AC_FL_RunContent(
				"codebase",						"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0",
				"width",							width,
				"height",							height,
				"align",							"middle",
				"src",								url,
				"quality",						"high",
				"id",									idnome,
				"movie",							url,
				"allowScriptAccess",	"always",
				"menu",								"false",		
				"scale",							"noscale",
				"wmode",							"transparent",
				"name",								idnome,
				"pluginspage",				"http://www.macromedia.com/go/getflashplayer",
				"type",								"application/x-shockwave-flash",
				"salign",							salign); //end AC code
		}

	}

	
//*****************************************************************************
//* Validar o e-mail dos formulários
//*****************************************************************************
	function ValidarEmail(obj){
		var objRegExp  = /^[A-Za-z]([\w\.]*)@([A-Za-z0-9\.]*)\.(([A-Za-z]{3}\.[A-Za-z]{2}$)|([A-Za-z]{3}$)|([a-z]{2}$))/i ;
		if (!objRegExp.test(obj.value))
			return 0;
		else
			return 1;
	}

//*****************************************************************************
//* Troca as imagens da galeria (clica foto pqna carrega a grande)
//*****************************************************************************
	function callExternalInterface(img,dsc,ftg) {
		/*alert(9);
		alert("params="+img+","+dsc+","+ftg);
		alert("obj="+fotogrande);
		alert("obj 2="+document.fotogrande);
*/
		//var teste = new SWFObject("fotogaleria.swf", "fotogrande", "100%", "100%");
		//teste.goHome(img,dsc,ftg);
		//teste.write("DivHome");

//var so = new SWFObject("fotogaleria.swf", "fotogrande", "100%", "100%","9");//, "9", "#FF6600");
		//so.addVariable("flashVarText", "this is passed in via FlashVars for example only"); // this line is optional, but this example uses the variable and displays this text inside the flash movie
	//	so.write("DivHome");
//$url="$path/flashes/fotogaleria.swf?idioma=$idioma";

			//DivHome.write(ExecSwf("flashes/fotogaleria.swf?idioma=$idioma","100%","100%"," ","fotogrande"));
				//$this->ExecSwfNoScr($url,"100%","100%"," ","fotogrande");	

		//fotogrande.focus();
		document.getElementById('DivHome').style.width='100%';
		document.getElementById('DivHome').style.height='100%';
		//document.getElementById('DivHome').style.textIndent='0px';

    obj = thisMovie("fotogrande");
		alert("nome:" + obj.name);
		obj.goHome(img,dsc,ftg);
//document["DivHome"]["fotogrande"].goHome(img,dsc,ftg);
//window.document.fotogrande.goHome(img,dsc,ftg);

	}

	function Teste(){
	DivHome.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" id="Untitled-1" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="fotogaleria.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="fotogaleria.swf" quality="high" bgcolor="#ffffff" width="550"  height="400" name="fotogrande" align="middle" allowScriptAccess="sameDomain"  type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" /></object>');
	
	}

	function thisMovie(movieName) {
/*		alert(5);
		alert("movie name="+movieName);
		alert("movie object IE="+window[movieName]);
		alert("movie object MZ="+document[movieName]);*/
		if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName]
    }
    else {
        return document[movieName]
    }
		
	}
//function CarregarSwf(idioma,img,dsc,fotografo){
function CarregarSwf(idioma,galeria,nrfoto){
//var fo = new FlashObject("http://www.imobiliariaflorianopolis.com.br/flashes/fotogaleria.swf?idioma="+idioma+"&fotogaleria="+img+"&dscfoto="+dsc+"&nmfotografo="+fotografo, "fotogrande", "100%", "100%", "9");
var fo = new FlashObject("http://www.hitechbrasil.com.br/sites/devi/flashes/fotogaleria.swf?idioma="+idioma+"&galeria="+galeria+"&nrfoto="+nrfoto, "fotogrande", "100%", "100%", "9");

fo.addParam("allowScriptAccess", "sameDomain");
fo.addParam("quality", "high");
fo.addParam("scale", "noscale");
fo.addParam("loop", "false");
fo.addParam("wmode", "transparent");
fo.write("DivHome");

}

//*****************************************************************************
//* Retira a cor do fundo do DIV assim que o falsh é carregado
//*****************************************************************************
	//funciona com o swfobject e não funciona com Call Interface External
	function fundoDiv() {
		document.getElementById('DivHome').style.visibility='hidden';
	}

	//funciona com Call Interface External e não funciona com o swfobject
	function fundoDivJS() {
		document.getElementById('DivHome').style.width='0';
		document.getElementById('DivHome').style.height='0';
		//document.getElementById('DivHome').style.textIndent='-9000px';
	}
