//por este link no body onde o swf for carregado
//<a id="zoomImg" href="#" style="display:none;visibility:hidden;"></a>

//Nota: jquery.fancybox-1.3.1.css comentar tudo apartir da linha 341, botão close no IE n aparece otherwise
function loadSwf(swf, divId, width, height, wmode ) {			

	var flashvars = {};
	flashvars.timeline = getQuerystring('timeline');
	
	/*
	var attributes = {
	  id: "myDynamicContent",
	  name: "myDynamicContent"
	};*/
	
	var params = {};
	//params.allowScriptAccess = "always";//para ExternalInterface.callback
	if (wmode )
		params.wmode = wmode;
	//params.wmode = "transparent";
	var attributes = {};
	//attributes.id = 'newIdQQcoisaServe';//meter esta id no swffit
	
	swfobject.embedSWF(swf, divId, width, height, "9.0.0", false, flashvars, params, attributes );
	swffit.fit(divId );
	
}//loadSwf

function loadFancyBox() {
	
	$(document).ready(function() {
	
		$("a#zoomImg").fancybox({
		'titleShow'		: false,
		'transitionIn'	: 'none',
		'transitionOut'	: 'none'
		});
	});
}//loadFancyBox

function coelhoDaCartola(file ) {
	
	//document.getElementById('my_flash' ).style.visibility = 'hidden';
	
	var j1 = getFlashMovie('zoomImg');
	j1.href = file;
	$('a#zoomImg').trigger('click');
  
}//coelhoDaCartola

//http://www.bloggingdeveloper.com/post/JavaScript-QueryString-ParseGet-QueryString-with-Client-Side-JavaScript.aspx
function getQuerystring(key, default_)
{
  if (default_==null) default_=""; 
  key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
  var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
  var qs = regex.exec(window.location.href);
  if(qs == null)
    return default_;
  else
    return qs[1];
}

// Provides the proper address for the movie depending on browser
function getFlashMovie(movieName) {
	var isIE = navigator.appName.indexOf("Microsoft") != -1;
	return (isIE) ? window[movieName] : document.getElementById(movieName );
}//getFlashMovie
