
////////
//
// PARAMENTROS:
// _SWF : nome do .swf
// _W : largura do .swf
// _H : altura do .swf
// _ID : id do .swf
// _BGCOLOR : cor do fundo do swf
//
////////
function dispSWF( _SWF, _W, _H, _ID, _BGCOLOR )
{
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("	codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ");
	document.write("	width=" + _W + " ");
	document.write("		height=" + _H + "  ");
	document.write("		id=" + _ID + " ");
	document.write("		align='middle'> ");
	document.write("	<param name='allowScriptAccess' value='sameDomain' /> ");
	document.write("	<param name='allowFullScreen' value='true' /> ");	
	document.write("	<param name='movie' value=" + _SWF + " /> ");
	document.write("	<param name='quality' value='high' /> ");
	document.write("	<param name='wmode' value='transparent' /> ");
	document.write("	<param name='bgcolor' value=" + _BGCOLOR + " /> ");
	document.write("	<embed src=" + _SWF + "  ");
	document.write("		quality='high'  ");
	document.write("		wmode='transparent' "); 
	document.write("		bgcolor=" + _BGCOLOR + "  ");
	document.write("		width=" + _W + " ");
	document.write("		height=" + _H + " ");
	document.write("		name=" + _ID + "  ");
	document.write("		align='middle' "); 
	document.write("		allowScriptAccess='sameDomain'  ");
	document.write("		allowFullScreen='true'  ");	
	document.write("		type='application/x-shockwave-flash' "); 
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}


function dispSWFSemXY( _SWF, _BGCOLOR  )
{

 var _W=150;
 var _H =180;
 var _ID = _SWF;
 var _BGCOLOR = '#ffffff'
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("	codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ");
	document.write("	width=" + _W + " ");
	document.write("		height=" + _H + "  ");
	document.write("		id=" + _ID + " ");
	document.write("		align='middle'> ");
	document.write("	<param name='allowScriptAccess' value='sameDomain' /> ");
	document.write("	<param name='allowFullScreen' value='true' /> ");	
	document.write("	<param name='movie' value=" + _SWF + " /> ");
	document.write("	<param name='quality' value='high' /> ");
	document.write("	<param name='wmode' value='transparent' /> ");
	document.write("	<param name='bgcolor' value=" + _BGCOLOR + " /> ");
	document.write("	<embed src=" + _SWF + "  ");
	document.write("		quality='high'  ");
	document.write("		wmode='transparent' "); 
	document.write("		bgcolor=" + _BGCOLOR + "  ");
	document.write("		width=" + _W + " ");
	document.write("		height=" + _H + " ");
	document.write("		name=" + _ID + "  ");
	document.write("		align='middle' "); 
	document.write("		allowScriptAccess='sameDomain'  ");
	document.write("		allowFullScreen='true'  ");	
	document.write("		type='application/x-shockwave-flash' "); 
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}

		
function dispSWFGSemXY( _SWF, _BGCOLOR  )
{

 var _W=220;
 var _H =270;
 var _ID = _SWF;
 var _BGCOLOR = '#ffffff'
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ");
	document.write("	codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' ");
	document.write("	width=" + _W + " ");
	document.write("		height=" + _H + "  ");
	document.write("		id=" + _ID + " ");
	document.write("		align='middle'> ");
	document.write("	<param name='allowScriptAccess' value='sameDomain' /> ");
	document.write("	<param name='allowFullScreen' value='true' /> ");	
	document.write("	<param name='movie' value=" + _SWF + " /> ");
	document.write("	<param name='quality' value='high' /> ");
	document.write("	<param name='wmode' value='transparent' /> ");
	document.write("	<param name='bgcolor' value=" + _BGCOLOR + " /> ");
	document.write("	<embed src=" + _SWF + "  ");
	document.write("		quality='high'  ");
	document.write("		wmode='transparent' "); 
	document.write("		bgcolor=" + _BGCOLOR + "  ");
	document.write("		width=" + _W + " ");
	document.write("		height=" + _H + " ");
	document.write("		name=" + _ID + "  ");
	document.write("		align='middle' "); 
	document.write("		allowScriptAccess='sameDomain'  ");
	document.write("		allowFullScreen='true'  ");	
	document.write("		type='application/x-shockwave-flash' "); 
	document.write("		pluginspage='http://www.macromedia.com/go/getflashplayer' /> ");
	document.write("	</object> ");
}


var dragObj = new Object();
dragObj.zIndex = 0;
function dragStart(event, id) {
	var el;
	var x, y;

	if (id)
		dragObj.elNode = document.getElementById(id);
	else {
		if (document.all)
			dragObj.elNode = window.event.srcElement;
		else
			dragObj.elNode = event.target;

		if (dragObj.elNode.nodeType == 3)
			dragObj.elNode = dragObj.elNode.parentNode;
		}
		if (document.all) {
			x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
			y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
		}
		else {
			x = event.clientX + window.scrollX;
			y = event.clientY + window.scrollY;
		}
		dragObj.cursorStartX = x;
		dragObj.cursorStartY = y;
		dragObj.elStartLeft  = parseInt(dragObj.elNode.style.left, 10);
		dragObj.elStartTop   = parseInt(dragObj.elNode.style.top,  10);
		if (isNaN(dragObj.elStartLeft)) dragObj.elStartLeft = 0;
		if (isNaN(dragObj.elStartTop))  dragObj.elStartTop  = 0;
		dragObj.elNode.style.zIndex = ++dragObj.zIndex;
		if (document.all) {
			document.attachEvent("onmousemove", dragGo);
			document.attachEvent("onmouseup",   dragStop);
			window.event.cancelBubble = true;
			window.event.returnValue = false;
		}
		else {
			document.addEventListener("mousemove", dragGo,   true);
			document.addEventListener("mouseup",   dragStop, true);
			event.preventDefault();
		}
}

function dragGo(event) {

	var x, y;

	
	if (document.all) {
		x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
		y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
	}
	else {
		x = event.clientX + window.scrollX;
		y = event.clientY + window.scrollY;
	}

	dragObj.elNode.style.left = (dragObj.elStartLeft + x - dragObj.cursorStartX) + "px";
	dragObj.elNode.style.top  = (dragObj.elStartTop  + y - dragObj.cursorStartY) + "px";
	if (document.all) {
		window.event.cancelBubble = true;
		window.event.returnValue = false;
	}
	else    
		event.preventDefault();
}

function dragStop(event) {

  if (document.all) {
    document.detachEvent("onmousemove", dragGo);
    document.detachEvent("onmouseup",   dragStop);
  }
  else {
    document.removeEventListener("mousemove", dragGo,   true);
    document.removeEventListener("mouseup",   dragStop, true);
  }
}
