/*
Created by Agência Dimmer 
Mídias Sociais, Sites, Hotsites, Mobile, Concursos, Promoções, SEO/SEM, Otimização, Métricas, Análises, Links Patrocinados, Marketing, Planejamento Estratégico, Branding e Pesquisa de Mercado
http://www.agenciadimmer.com.br
*/  

/* Retira a borda dos flashes
Copyright 2006 Adobe Systems, Inc. All rights reserved.
Versão compacta, alterada por Renato Herculano
	- src, width e height são obrigatórios
	- os demais parametros são opcionais
*/
function flash(src, width, height, id, flashVars, wmode, menu, scale){
	var ret = GetArguments(src, width, height, id, flashVars, wmode, menu, scale);
	var str = '<object ';
	for (var i in ret.objAttrs)
		str += i + '="' + ret.objAttrs[i] + '" ';
	str += '>';
	for (var i in ret.params)
		str += '<param name="' + i + '" value="' + ret.params[i] + '" /> ';
	str += '</object>';
	document.write(str);
}

//GetArguments(): função auxiliar para retirar a borda dos flashes
//	- retorna os argumentos da tag object e os parametros
function GetArguments(src, w, h, id, flashVars, wmode, menu, scale){
	var ret = new Object();
	ret.params = new Object();
	ret.objAttrs = new Object();

	ret.objAttrs['data'] = ret.params['movie'] = src;
	ret.objAttrs['width'] = w;
	ret.objAttrs['height'] = h;
	ret.params['quality'] = 'high';
	ret.objAttrs['type'] = 'application/x-shockwave-flash';
	ret.params['menu'] = 'false';
	
	if(id) ret.objAttrs['id'] = id;

	if(flashVars) ret.params['flashVars'] = flashVars;
	
	ret.params['wmode'] = (wmode) ? wmode : 'transparent';
	ret.params['scale'] = (scale) ? scale : 'exactfit';
	ret.params['menu'] = (menu) ? menu : 'false';
	
	return ret;
}

function checkPluginFlash() { //v4.0
	var plgIn = 'Shockwave Flash';
	var flash = document.getElementById('flash');
	var img = document.getElementById('imagem');
	var autoGo = true;
	var ok = false;
	document.MM_returnValue = false;
	with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
		ok=(plugins && plugins[plgIn]);
	}
	else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
		if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
		else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
		else ok=autoGo;
	}
	//if (!ok) flash = img; if (flash) flash.style.display = "block";
	if (!ok)
		return false;
	else
		return true;
}
