var current_loc = '';
var current_height = 0;
var flash = false;

var setHeight = function(h)
{
	current_height = h > document.body.clientHeight ? h : 0;
	flash.style.height = h > document.body.clientHeight ? h+'px' : '100%';
};

var setAnc=function(name){ document.location.hash=name; current_loc=document.location.hash; };

var checkLocation = function()
{
	var hash = document.location.hash;
    if (hash!==current_loc)
	{
		current_loc = hash;
		var obj={};
		hash.replace(/(\w+)=([\w\/.]+)/g, function(s, k, v){ obj[k]=v; });
		flash.retAnc(obj);
    }
};

var resizeHandler = function()
{
	if(document.body.clientHeight > current_height) flash.style.height = '100%';
};

var init = function()
{
	var MSIE = (navigator.userAgent.indexOf("Microsoft") != -1) && !window.opera;
	flash = MSIE ? window['flash'] : document['flash'];
	window.onresize = resizeHandler;
	checkLocation();
	var watchAnc = setInterval(checkLocation, 500);
};

swfobject.embedSWF('/preloader.swf', 'flash', '100%', '100%', '9.0.0', '/public/flash/expressInstall.swf', false,
	{
		'allowFullScreen'	: true,
		'allowScriptAccess' : 'sameDomain',
		'salign'			: 'lt',
		'scale'				: 'noScale',
		'wmode'				: 'window'
	});
