//
var _swfvars = {};
var _swfid = "_jigidiPuzzleNode";
var _swfbg = "#ffffff";
var _swfwidth = "100%";
var _swfheight = "100%";
var _swffilename = null;

// puzzle specific
var _jiglocalref = false;
var _jigpid;

var _swf_url = "http://www.jigidi.com/swf/";
//_swf_url = "http://localhost.jigidi.com/swf/";


function jigPuzzle()
{
	_swfvars.puzzleID=_jigpid;
	if (_jiglocalref) _swfvars.localref=true;
	swfFlashContent("PuzzleAS3.swf?1.44");
}

function swfFlashContent(filename)
{
	_swffilename = _swf_url+filename;
	
	var vars = new Array();
	for (var k in _swfvars)
	{
		vars.push(k+"="+_swfvars[k]);
	}
	vars = vars.join("&");
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="'+_swfwidth+'" height="'+_swfheight+'" id="'+_swfid+'" align="middle" VIEWASTEXT>');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="allowFullScreen" value="true" />');
	document.write('<param name="menu" value="false" />');
	document.write('<param name="scale" value="noscale" />');
	document.write('<param name="movie" value="'+_swffilename+'" />');
	document.write('<param name="quality" value="high" />');
	document.write('<param name="bgcolor" value="'+_swfbg+'" />');
	document.write('<param name="flashvars" value="'+vars+'" />');
	var fv = " flashvars=\""+vars+"\"";
	document.write('<embed src="'+_swffilename+'"'+fv+' quality="high" bgcolor="'+_swfbg+'" width="'+_swfwidth+'" height="'+_swfheight+'" name="'+_swfid+'" menu="false" scale="noscale" align="middle" swliveconnect="true" allowfullscreen="true" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />');
	document.write('</object>');
}	


